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
2666ec40
Commit
2666ec40
authored
Mar 03, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved toolbar indicator list from QGCCorePlugin to FirmwarePlugin.
parent
6190d361
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
24 deletions
+56
-24
APMFirmwarePlugin.h
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
+3
-3
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+14
-0
ArduSubFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
+1
-0
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+15
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+9
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+9
-0
Vehicle.h
src/Vehicle/Vehicle.h
+3
-0
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+1
-15
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+0
-5
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+1
-1
No files found.
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
View file @
2666ec40
...
...
@@ -104,7 +104,7 @@ protected:
APMFirmwarePlugin
(
void
);
void
setSupportedModes
(
QList
<
APMCustomMode
>
supportedModes
);
bool
_coaxialMotors
;
bool
_coaxialMotors
;
private
slots
:
void
_artooSocketError
(
QAbstractSocket
::
SocketError
socketError
);
...
...
@@ -125,8 +125,8 @@ private:
QList
<
APMCustomMode
>
_supportedModes
;
QMap
<
QString
,
QTime
>
_noisyPrearmMap
;
static
const
char
*
_artooIP
;
static
const
int
_artooVideoHandshakePort
;
static
const
char
*
_artooIP
;
static
const
int
_artooVideoHandshakePort
;
};
...
...
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
2666ec40
...
...
@@ -106,3 +106,17 @@ bool ArduSubFirmwarePlugin::supportsMotorInterference(void)
{
return
false
;
}
QVariantList
&
ArduSubFirmwarePlugin
::
toolBarIndicators
(
const
Vehicle
*
vehicle
)
{
Q_UNUSED
(
vehicle
);
//-- Sub specific list of indicators (Enter your modified list here)
if
(
_toolBarIndicatorList
.
size
()
==
0
)
{
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/TelemetryRSSIIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/RCRSSIIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)));
}
return
_toolBarIndicatorList
;
}
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
View file @
2666ec40
...
...
@@ -86,6 +86,7 @@ public:
QString
brandImage
(
const
Vehicle
*
vehicle
)
const
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/APM/BrandImageSub"
);
}
const
FirmwarePlugin
::
remapParamNameMajorVersionMap_t
&
paramNameRemapMajorVersionMap
(
void
)
const
final
{
return
_remapParamName
;
}
int
remapParamNameHigestMinorVersionNumber
(
int
majorVersionNumber
)
const
final
;
QVariantList
&
toolBarIndicators
(
const
Vehicle
*
vehicle
)
final
;
private:
static
bool
_remapParamNameIntialized
;
...
...
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
2666ec40
...
...
@@ -337,3 +337,18 @@ QString FirmwarePlugin::vehicleImageCompass(const Vehicle* vehicle) const
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/compassInstrumentArrow.svg"
);
}
QVariantList
&
FirmwarePlugin
::
toolBarIndicators
(
const
Vehicle
*
vehicle
)
{
Q_UNUSED
(
vehicle
);
//-- Default list of indicators for all vehicles.
if
(
_toolBarIndicatorList
.
size
()
==
0
)
{
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/TelemetryRSSIIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/RCRSSIIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)));
_toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)));
}
return
_toolBarIndicatorList
;
}
src/FirmwarePlugin/FirmwarePlugin.h
View file @
2666ec40
...
...
@@ -22,6 +22,7 @@
#include <QList>
#include <QString>
#include <QVariantList>
class
Vehicle
;
...
...
@@ -256,8 +257,16 @@ public:
/// Return the resource file which contains the vehicle icon used in the compass
virtual
QString
vehicleImageCompass
(
const
Vehicle
*
vehicle
)
const
;
/// Allows the core plugin to override the toolbar indicators
/// @return A list of QUrl with the indicators (see MainToolBarIndicators.qml)
virtual
QVariantList
&
toolBarIndicators
(
const
Vehicle
*
vehicle
);
// FIXME: Hack workaround for non pluginize FollowMe support
static
const
char
*
px4FollowMeFlightMode
;
protected:
QVariantList
_toolBarIndicatorList
;
};
class
FirmwarePluginFactory
:
public
QObject
...
...
src/Vehicle/Vehicle.cc
View file @
2666ec40
...
...
@@ -2375,6 +2375,15 @@ QString Vehicle::vehicleImageCompass() const
return
QString
();
}
QVariantList
&
Vehicle
::
toolBarIndicators
()
{
if
(
_firmwarePlugin
)
{
return
_firmwarePlugin
->
toolBarIndicators
(
this
);
}
static
QVariantList
emptyList
;
return
emptyList
;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
src/Vehicle/Vehicle.h
View file @
2666ec40
...
...
@@ -307,6 +307,7 @@ public:
Q_PROPERTY
(
unsigned
int
telemetryTXBuffer
READ
telemetryTXBuffer
NOTIFY
telemetryTXBufferChanged
)
Q_PROPERTY
(
unsigned
int
telemetryLNoise
READ
telemetryLNoise
NOTIFY
telemetryLNoiseChanged
)
Q_PROPERTY
(
unsigned
int
telemetryRNoise
READ
telemetryRNoise
NOTIFY
telemetryRNoiseChanged
)
Q_PROPERTY
(
QVariantList
toolBarIndicators
READ
toolBarIndicators
CONSTANT
)
/// true: Vehicle is flying, false: Vehicle is on ground
Q_PROPERTY
(
bool
flying
READ
flying
WRITE
setFlying
NOTIFY
flyingChanged
)
...
...
@@ -651,6 +652,8 @@ public:
QString
vehicleImageOutline
()
const
;
QString
vehicleImageCompass
()
const
;
QVariantList
&
toolBarIndicators
();
public
slots
:
/// Sets the firmware plugin instance data associated with this Vehicle. This object will be parented to the Vehicle
/// and destroyed when the vehicle goes away.
...
...
src/api/QGCCorePlugin.cc
View file @
2666ec40
...
...
@@ -67,7 +67,6 @@ public:
QGCSettings
*
pDebug
;
#endif
QVariantList
settingsList
;
QVariantList
toolBarIndicatorList
;
QGCOptions
*
defaultOptions
;
};
...
...
@@ -142,23 +141,10 @@ QGCOptions* QGCCorePlugin::options()
return
_p
->
defaultOptions
;
}
QVariantList
&
QGCCorePlugin
::
toolBarIndicators
()
{
if
(
_p
->
toolBarIndicatorList
.
size
()
==
0
)
{
_p
->
toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)));
_p
->
toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSIndicator.qml"
)));
_p
->
toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/TelemetryRSSIIndicator.qml"
)));
_p
->
toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/RCRSSIIndicator.qml"
)));
_p
->
toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)));
_p
->
toolBarIndicatorList
.
append
(
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)));
}
return
_p
->
toolBarIndicatorList
;
}
bool
QGCCorePlugin
::
overrideSettingsGroupVisibility
(
QString
name
)
{
Q_UNUSED
(
name
);
// Always show all
return
true
;
}
...
...
src/api/QGCCorePlugin.h
View file @
2666ec40
...
...
@@ -36,16 +36,11 @@ public:
Q_PROPERTY
(
QVariantList
settings
READ
settings
CONSTANT
)
Q_PROPERTY
(
int
defaultSettings
READ
defaultSettings
CONSTANT
)
Q_PROPERTY
(
QGCOptions
*
options
READ
options
CONSTANT
)
Q_PROPERTY
(
QVariantList
toolBarIndicators
READ
toolBarIndicators
CONSTANT
)
/// The list of settings under the Settings Menu
/// @return A list of QGCSettings
virtual
QVariantList
&
settings
();
/// Allows the core plugin to override the toolbar indicators
/// @return A list of QUrl with the indicators (see MainToolBarIndicators.qml)
virtual
QVariantList
&
toolBarIndicators
();
/// The default settings panel to show
/// @return The settings index
virtual
int
defaultSettings
();
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
2666ec40
...
...
@@ -31,7 +31,7 @@ Item {
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
visible
:
!
communicationLost
Repeater
{
model
:
QGroundControl
.
corePlugin
.
toolBarIndicators
model
:
activeVehicle
?
activeVehicle
.
toolBarIndicators
:
[]
Loader
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
...
...
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