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
58b9c3f6
Commit
58b9c3f6
authored
Dec 20, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2432 from DonLakeFlyer/APMPlane
APM plane fixes
parents
8eced4a7
b887cbd9
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
24 deletions
+46
-24
qgroundcontrol.pro
qgroundcontrol.pro
+3
-1
APMAirframeComponent.cc
src/AutoPilotPlugins/APM/APMAirframeComponent.cc
+29
-11
APMAirframeComponent.h
src/AutoPilotPlugins/APM/APMAirframeComponent.h
+1
-1
APMAutoPilotPlugin.cc
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
+6
-8
APMFlightModesComponent.qml
src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
+5
-3
SetupView.qml
src/VehicleSetup/SetupView.qml
+2
-0
No files found.
qgroundcontrol.pro
View file @
58b9c3f6
...
...
@@ -544,10 +544,12 @@ SOURCES += \
#
INCLUDEPATH
+=
\
src
/
AutoPilotPlugins
/
APM
\
src
/
AutoPilotPlugins
/
Common
\
src
/
AutoPilotPlugins
/
PX4
\
src
/
AutoPilotPlugins
/
APM
\
src
/
FirmwarePlugin
\
src
/
FirmwarePlugin
/
APM
\
src
/
FirmwarePlugin
/
PX4
\
src
/
Vehicle
\
src
/
VehicleSetup
\
...
...
src/AutoPilotPlugins/APM/APMAirframeComponent.cc
View file @
58b9c3f6
...
...
@@ -25,13 +25,14 @@
/// @author Don Gagne <don@thegagnes.com>
#include "APMAirframeComponent.h"
#include "
QGCQmlWidgetHolder
.h"
#include "
ArduCopterFirmwarePlugin
.h"
APMAirframeComponent
::
APMAirframeComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APMComponent
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Airframe"
))
APMAirframeComponent
::
APMAirframeComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APMComponent
(
vehicle
,
autopilot
,
parent
)
,
_copterFirmware
(
false
)
,
_name
(
"Airframe"
)
{
_copterFirmware
=
qobject_cast
<
ArduCopterFirmwarePlugin
*>
(
_vehicle
->
firmwarePlugin
())
!=
NULL
;
}
QString
APMAirframeComponent
::
name
(
void
)
const
...
...
@@ -52,28 +53,45 @@ QString APMAirframeComponent::iconResource(void) const
bool
APMAirframeComponent
::
requiresSetup
(
void
)
const
{
return
tru
e
;
return
_copterFirmwar
e
;
}
bool
APMAirframeComponent
::
setupComplete
(
void
)
const
{
//: Not the correct one, but it works for the moment.
return
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
"FRAME"
)
->
rawValue
().
toInt
()
!=
-
1
;
if
(
_copterFirmware
)
{
return
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
"FRAME"
)
->
rawValue
().
toInt
()
>=
0
;
}
else
{
return
true
;
}
}
QStringList
APMAirframeComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
return
QStringList
();
QStringList
list
;
if
(
_copterFirmware
)
{
list
<<
"FRAME"
;
}
return
list
;
}
QUrl
APMAirframeComponent
::
setupSource
(
void
)
const
{
if
(
_copterFirmware
)
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/APMAirframeComponent.qml"
);
}
else
{
return
QUrl
();
}
}
QUrl
APMAirframeComponent
::
summaryQmlSource
(
void
)
const
{
if
(
_copterFirmware
)
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/APMAirframeComponentSummary.qml"
);
}
else
{
return
QUrl
();
}
}
QString
APMAirframeComponent
::
prerequisiteSetup
(
void
)
const
...
...
src/AutoPilotPlugins/APM/APMAirframeComponent.h
View file @
58b9c3f6
...
...
@@ -47,8 +47,8 @@ public:
virtual
QString
prerequisiteSetup
(
void
)
const
;
private:
bool
_copterFirmware
;
const
QString
_name
;
QVariantList
_summaryItems
;
};
#endif
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
58b9c3f6
...
...
@@ -67,7 +67,6 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
Q_ASSERT
(
_vehicle
);
if
(
parametersReady
())
{
if
(
dynamic_cast
<
ArduCopterFirmwarePlugin
*>
(
_vehicle
->
firmwarePlugin
())){
_airframeComponent
=
new
APMAirframeComponent
(
_vehicle
,
this
);
if
(
_airframeComponent
)
{
_airframeComponent
->
setupTriggerSignals
();
...
...
@@ -75,7 +74,6 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
}
else
{
qWarning
()
<<
"new APMAirframeComponent failed"
;
}
}
_flightModesComponent
=
new
APMFlightModesComponent
(
_vehicle
,
this
);
if
(
_flightModesComponent
)
{
...
...
src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
View file @
58b9c3f6
...
...
@@ -36,6 +36,7 @@ QGCView {
viewPanel
:
panel
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
property
bool
_channelOptionsAvailable
:
controller
.
parameterExists
(
-
1
,
"
CH7_OPT
"
)
// Not available in all firmware types
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
panel
.
enabled
}
...
...
@@ -116,6 +117,7 @@ QGCView {
anchors.left
:
flightModeSettings
.
right
text
:
"
Channel Options
"
font.weight
:
Font
.
DemiBold
visible
:
_channelOptionsAvailable
}
Rectangle
{
...
...
@@ -126,6 +128,7 @@ QGCView {
width
:
channelOptColumn
.
width
+
(
_margins
*
2
)
height
:
channelOptColumn
.
height
+
ScreenTools
.
defaultFontPixelHeight
color
:
qgcPal
.
windowShade
visible
:
_channelOptionsAvailable
Column
{
id
:
channelOptColumn
...
...
@@ -141,19 +144,18 @@ QGCView {
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
int
index
:
modelData
+
7
property
Fact
nullFact
:
Fact
{
}
QGCLabel
{
anchors.baseline
:
optCombo
.
baseline
text
:
"
Channel option
"
+
index
+
"
:
"
color
:
controller
.
channelOptionEnabled
[
modelData
]
?
qgcPal
.
buttonHighlight
:
qgcPal
.
text
Component.onCompleted
:
console
.
log
(
index
,
controller
.
channelOptionEnabled
[
modelData
])
}
FactComboBox
{
id
:
optCombo
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
fact
:
controller
.
getParameterFact
(
-
1
,
"
CH
"
+
index
+
"
_OPT
"
)
fact
:
_channelOptionsAvailable
?
controller
.
getParameterFact
(
-
1
,
"
CH
"
+
index
+
"
_OPT
"
)
:
nullFact
indexModel
:
false
}
}
...
...
src/VehicleSetup/SetupView.qml
View file @
58b9c3f6
...
...
@@ -299,6 +299,8 @@ Rectangle {
setupComplete
:
modelData
.
setupComplete
exclusiveGroup
:
setupButtonGroup
text
:
modelData
.
name
visible
:
modelData
.
setupSource
.
toString
()
!=
""
onClicked
:
showVehicleComponentPanel
(
modelData
)
}
...
...
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