Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f6a19404
Unverified
Commit
f6a19404
authored
Jun 06, 2019
by
Gus Grubba
Committed by
GitHub
Jun 06, 2019
Browse files
Merge pull request #7505 from mavlink/multipleVehicleTypes
Multiple vehicle types
parents
58227dfd
cfe602e3
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/FirmwarePlugin/FirmwarePluginManager.cc
View file @
f6a19404
...
...
@@ -16,7 +16,7 @@
FirmwarePluginManager
::
FirmwarePluginManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
,
_genericFirmwarePlugin
(
NULL
)
,
_genericFirmwarePlugin
(
nullptr
)
{
}
...
...
@@ -58,7 +58,7 @@ QList<MAV_TYPE> FirmwarePluginManager::supportedVehicleTypes(MAV_AUTOPILOT firmw
FirmwarePlugin
*
FirmwarePluginManager
::
firmwarePluginForAutopilot
(
MAV_AUTOPILOT
firmwareType
,
MAV_TYPE
vehicleType
)
{
FirmwarePluginFactory
*
factory
=
_findPluginFactory
(
firmwareType
);
FirmwarePlugin
*
plugin
=
NULL
;
FirmwarePlugin
*
plugin
=
nullptr
;
if
(
factory
)
{
plugin
=
factory
->
firmwarePluginForAutopilot
(
firmwareType
,
vehicleType
);
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePluginFactory.cc
View file @
f6a19404
...
...
@@ -16,7 +16,7 @@
PX4FirmwarePluginFactory
PX4FirmwarePluginFactory
;
PX4FirmwarePluginFactory
::
PX4FirmwarePluginFactory
(
void
)
:
_pluginInstance
(
NULL
)
:
_pluginInstance
(
nullptr
)
{
}
...
...
@@ -40,5 +40,5 @@ FirmwarePlugin* PX4FirmwarePluginFactory::firmwarePluginForAutopilot(MAV_AUTOPIL
return
_pluginInstance
;
}
return
NULL
;
return
nullptr
;
}
src/PlanView/MissionSettingsEditor.qml
View file @
f6a19404
...
...
@@ -30,6 +30,7 @@ Rectangle {
property
bool
_showCruiseSpeed
:
!
_missionVehicle
.
multiRotor
property
bool
_showHoverSpeed
:
_missionVehicle
.
multiRotor
||
_missionVehicle
.
vtol
property
bool
_multipleFirmware
:
QGroundControl
.
supportedFirmwareCount
>
2
property
bool
_multipleVehicleTypes
:
QGroundControl
.
supportedVehicleCount
>
1
property
real
_fieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
16
property
bool
_mobile
:
ScreenTools
.
isMobile
property
var
_savePath
:
QGroundControl
.
settingsManager
.
appSettings
.
missionSavePath
...
...
@@ -158,13 +159,13 @@ Rectangle {
QGCLabel
{
text
:
_vehicleLabel
Layout.fillWidth
:
true
visible
:
_
showOfflin
eVehicle
Combo
s
visible
:
_
multipl
eVehicle
Type
s
}
FactComboBox
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingVehicleType
indexModel
:
false
Layout.preferredWidth
:
_fieldWidth
visible
:
_
showOfflin
eVehicle
Combo
s
visible
:
_
multipl
eVehicle
Type
s
enabled
:
_enableOfflineVehicleCombos
}
...
...
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
f6a19404
...
...
@@ -190,6 +190,18 @@ int QGroundControlQmlGlobal::supportedFirmwareCount()
return
_firmwarePluginManager
->
supportedFirmwareTypes
().
count
();
}
int
QGroundControlQmlGlobal
::
supportedVehicleCount
()
{
int
count
=
0
;
QList
<
MAV_AUTOPILOT
>
list
=
_firmwarePluginManager
->
supportedFirmwareTypes
();
foreach
(
auto
firmware
,
list
)
{
if
(
firmware
!=
MAV_AUTOPILOT_GENERIC
)
{
count
+=
_firmwarePluginManager
->
supportedVehicleTypes
(
firmware
).
count
();
}
}
return
count
;
}
bool
QGroundControlQmlGlobal
::
px4ProFirmwareSupported
()
{
return
_firmwarePluginManager
->
supportedFirmwareTypes
().
contains
(
MAV_AUTOPILOT_PX4
);
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
f6a19404
...
...
@@ -77,8 +77,9 @@ public:
Q_PROPERTY
(
bool
microhardSupported
READ
microhardSupported
CONSTANT
)
Q_PROPERTY
(
int
supportedFirmwareCount
READ
supportedFirmwareCount
CONSTANT
)
Q_PROPERTY
(
int
supportedVehicleCount
READ
supportedVehicleCount
CONSTANT
)
Q_PROPERTY
(
bool
px4ProFirmwareSupported
READ
px4ProFirmwareSupported
CONSTANT
)
Q_PROPERTY
(
int
apmFirmwareSupported
READ
apmFirmwareSupported
CONSTANT
)
Q_PROPERTY
(
int
apmFirmwareSupported
READ
apmFirmwareSupported
CONSTANT
)
Q_PROPERTY
(
qreal
zOrderTopMost
READ
zOrderTopMost
CONSTANT
)
///< z order for top most items, toolbar, main window sub view
Q_PROPERTY
(
qreal
zOrderWidgets
READ
zOrderWidgets
CONSTANT
)
///< z order value to widgets, for example: zoom controls, hud widgetss
...
...
@@ -203,6 +204,7 @@ public:
#endif
int
supportedFirmwareCount
();
int
supportedVehicleCount
();
bool
px4ProFirmwareSupported
();
bool
apmFirmwareSupported
();
bool
skipSetupPage
()
{
return
_skipSetupPage
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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