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
599cd32c
Commit
599cd32c
authored
Oct 29, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2153 from DonLakeFlyer/APMAiframeComponent
Empty APM Airframe vehicle component
parents
788928e1
d24d0a05
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
404 additions
and
6 deletions
+404
-6
QGCApplication.pro
QGCApplication.pro
+4
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+4
-0
APMAirframeComponent.cc
src/AutoPilotPlugins/APM/APMAirframeComponent.cc
+116
-0
APMAirframeComponent.h
src/AutoPilotPlugins/APM/APMAirframeComponent.h
+56
-0
APMAirframeComponent.qml
src/AutoPilotPlugins/APM/APMAirframeComponent.qml
+51
-0
APMAirframeComponentSummary.qml
src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml
+45
-0
APMAutoPilotPlugin.cc
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
+17
-5
APMAutoPilotPlugin.h
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
+4
-1
APMComponent.cc
src/AutoPilotPlugins/APM/APMComponent.cc
+53
-0
APMComponent.h
src/AutoPilotPlugins/APM/APMComponent.h
+54
-0
No files found.
QGCApplication.pro
View file @
599cd32c
...
...
@@ -509,6 +509,8 @@ HEADERS+= \
src
/
AutoPilotPlugins
/
AutoPilotPlugin
.
h
\
src
/
AutoPilotPlugins
/
AutoPilotPluginManager
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMAutoPilotPlugin
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponent
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMComponent
.
h
\
src
/
AutoPilotPlugins
/
Generic
/
GenericAutoPilotPlugin
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponent
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponentAirframes
.
h
\
...
...
@@ -551,6 +553,8 @@ SOURCES += \
src
/
AutoPilotPlugins
/
AutoPilotPlugin
.
cc
\
src
/
AutoPilotPlugins
/
AutoPilotPluginManager
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAutoPilotPlugin
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponent
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMComponent
.
cc
\
src
/
AutoPilotPlugins
/
Generic
/
GenericAutoPilotPlugin
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponent
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponentAirframes
.
cc
\
...
...
qgroundcontrol.qrc
View file @
599cd32c
...
...
@@ -81,6 +81,10 @@
<file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file>
<file alias="MissionEditorHelp.qml">src/MissionEditor/MissionEditorHelp.qml</file>
<file alias="APMAirframeComponent.qml">src/AutoPilotPlugins/APM/APMAirframeComponent.qml</file>
<file alias="APMAirframeComponentSummary.qml">src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml</file>
<!-- FlightDisplay module -->
<file alias="QGroundControl/FlightDisplay/qmldir">src/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file>
...
...
src/AutoPilotPlugins/APM/APMAirframeComponent.cc
0 → 100644
View file @
599cd32c
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "APMAirframeComponent.h"
#include "QGCQmlWidgetHolder.h"
APMAirframeComponent
::
APMAirframeComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APMComponent
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Airframe"
))
{
}
QString
APMAirframeComponent
::
name
(
void
)
const
{
return
_name
;
}
QString
APMAirframeComponent
::
description
(
void
)
const
{
return
tr
(
"The Airframe Component is used to select the airframe which matches your vehicle. "
"This will in turn set up the various tuning values for flight paramters."
);
}
QString
APMAirframeComponent
::
iconResource
(
void
)
const
{
return
"/qmlimages/AirframeComponentIcon.png"
;
}
bool
APMAirframeComponent
::
requiresSetup
(
void
)
const
{
return
true
;
}
bool
APMAirframeComponent
::
setupComplete
(
void
)
const
{
// You'll need to figure out which parameters trigger setup complete
#if 0
return _autopilot->getParameterFact(FactSystem::defaultComponentId, "SYS_AUTOSTART")->value().toInt() != 0;
#else
return
true
;
#endif
}
QString
APMAirframeComponent
::
setupStateDescription
(
void
)
const
{
const
char
*
stateDescription
;
if
(
requiresSetup
())
{
stateDescription
=
"Requires calibration"
;
}
else
{
stateDescription
=
"Calibrated"
;
}
return
QString
(
stateDescription
);
}
QStringList
APMAirframeComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
// You'll need to figure out which parameters trigger setup complete
#if 0
return QStringList("SYS_AUTOSTART");
#else
return
QStringList
();
#endif
}
QStringList
APMAirframeComponent
::
paramFilterList
(
void
)
const
{
#if 0
QStringList list;
list << "SYS_AUTOSTART";
return list;
#else
return
QStringList
();
#endif
}
QUrl
APMAirframeComponent
::
setupSource
(
void
)
const
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/APMAirframeComponent.qml"
);
}
QUrl
APMAirframeComponent
::
summaryQmlSource
(
void
)
const
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/APMAirframeComponentSummary.qml"
);
}
QString
APMAirframeComponent
::
prerequisiteSetup
(
void
)
const
{
return
QString
();
}
src/AutoPilotPlugins/APM/APMAirframeComponent.h
0 → 100644
View file @
599cd32c
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef APMAirframeComponent_H
#define APMAirframeComponent_H
#include "APMComponent.h"
class
APMAirframeComponent
:
public
APMComponent
{
Q_OBJECT
public:
APMAirframeComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from APMComponent
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
virtual
QString
name
(
void
)
const
;
virtual
QString
description
(
void
)
const
;
virtual
QString
iconResource
(
void
)
const
;
virtual
bool
requiresSetup
(
void
)
const
;
virtual
bool
setupComplete
(
void
)
const
;
virtual
QString
setupStateDescription
(
void
)
const
;
virtual
QUrl
setupSource
(
void
)
const
;
virtual
QStringList
paramFilterList
(
void
)
const
;
virtual
QUrl
summaryQmlSource
(
void
)
const
;
virtual
QString
prerequisiteSetup
(
void
)
const
;
private:
const
QString
_name
;
QVariantList
_summaryItems
;
};
#endif
src/AutoPilotPlugins/APM/APMAirframeComponent.qml
0 → 100644
View file @
599cd32c
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
ScreenTools
1.0
QGCView
{
id
:
qgcView
viewPanel
:
panel
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
panel
.
enabled
}
QGCViewPanel
{
id
:
panel
anchors.fill
:
parent
QGCLabel
{
text
:
"
Work in progress
"
;
}
}
// QGCViewPanel
}
// QGCView
src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml
0 → 100644
View file @
599cd32c
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
Palette
1.0
FactPanel
{
id
:
panel
anchors.fill
:
parent
color
:
qgcPal
.
windowShadeDark
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
/*
property Fact sysIdFact: controller.getParameterFact(-1, "MAV_SYS_ID")
property Fact sysAutoStartFact: controller.getParameterFact(-1, "SYS_AUTOSTART")
property bool autoStartSet: sysAutoStartFact.value != 0
*/
Column
{
anchors.fill
:
parent
anchors.margins
:
8
/*
VehicleSummaryRow {
labelText: "System ID:"
valueText: sysIdFact.valueString
}
VehicleSummaryRow {
labelText: "Airframe type:"
valueText: autoStartSet ? controller.currentAirframeType : "Setup required"
}
VehicleSummaryRow {
labelText: "Vehicle:"
valueText: autoStartSet ? controller.currentVehicleName : "Setup required"
}
*/
}
}
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
599cd32c
...
...
@@ -29,9 +29,10 @@
#include "FirmwarePlugin/APM/APMFirmwarePlugin.h" // FIXME: Hack
/// This is the AutoPilotPlugin implementatin for the MAV_AUTOPILOT_ARDUPILOT type.
APMAutoPilotPlugin
::
APMAutoPilotPlugin
(
Vehicle
*
vehicle
,
QObject
*
parent
)
:
AutoPilotPlugin
(
vehicle
,
parent
),
_incorrectParameterVersion
(
false
)
APMAutoPilotPlugin
::
APMAutoPilotPlugin
(
Vehicle
*
vehicle
,
QObject
*
parent
)
:
AutoPilotPlugin
(
vehicle
,
parent
)
,
_incorrectParameterVersion
(
false
)
,
_airframeComponent
(
NULL
)
{
Q_ASSERT
(
vehicle
);
}
...
...
@@ -43,9 +44,20 @@ APMAutoPilotPlugin::~APMAutoPilotPlugin()
const
QVariantList
&
APMAutoPilotPlugin
::
vehicleComponents
(
void
)
{
static
const
QVariantList
emptyList
;
if
(
_components
.
count
()
==
0
&&
!
_incorrectParameterVersion
)
{
Q_ASSERT
(
_vehicle
);
return
emptyList
;
if
(
parametersReady
())
{
_airframeComponent
=
new
APMAirframeComponent
(
_vehicle
->
uas
(),
this
);
Q_CHECK_PTR
(
_airframeComponent
);
_airframeComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_airframeComponent
));
}
else
{
qWarning
()
<<
"Call to vehicleCompenents prior to parametersReady"
;
}
}
return
_components
;
}
/// This will perform various checks prior to signalling that the plug in ready
...
...
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
View file @
599cd32c
...
...
@@ -26,6 +26,7 @@
#include "AutoPilotPlugin.h"
#include "Vehicle.h"
#include "APMAirframeComponent.h"
/// This is the APM specific implementation of the AutoPilot class.
class
APMAutoPilotPlugin
:
public
AutoPilotPlugin
...
...
@@ -44,7 +45,9 @@ public slots:
void
_parametersReadyPreChecks
(
bool
missingParameters
);
private:
bool
_incorrectParameterVersion
;
///< true: parameter version incorrect, setup not allowed
bool
_incorrectParameterVersion
;
///< true: parameter version incorrect, setup not allowed
QVariantList
_components
;
APMAirframeComponent
*
_airframeComponent
;
};
#endif
src/AutoPilotPlugins/APM/APMComponent.cc
0 → 100644
View file @
599cd32c
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "APMComponent.h"
#include "Fact.h"
#include "AutoPilotPlugin.h"
APMComponent
::
APMComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
VehicleComponent
(
uas
,
autopilot
,
parent
)
{
Q_ASSERT
(
uas
);
Q_ASSERT
(
autopilot
);
}
void
APMComponent
::
setupTriggerSignals
(
void
)
{
// Watch for changed on trigger list params
foreach
(
QString
paramName
,
setupCompleteChangedTriggerList
())
{
Fact
*
fact
=
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
paramName
);
connect
(
fact
,
&
Fact
::
valueChanged
,
this
,
&
APMComponent
::
_triggerUpdated
);
}
}
void
APMComponent
::
_triggerUpdated
(
QVariant
value
)
{
Q_UNUSED
(
value
);
emit
setupCompleteChanged
(
setupComplete
());
}
src/AutoPilotPlugins/APM/APMComponent.h
0 → 100644
View file @
599cd32c
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef APMComponent_H
#define APMComponent_H
#include "VehicleComponent.h"
#include <QStringList>
/// @file
/// @brief This class is used as an abstract base class for all PX4 VehicleComponent objects.
/// @author Don Gagne <don@thegagnes.com>
class
APMComponent
:
public
VehicleComponent
{
Q_OBJECT
public:
APMComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
/// @brief Returns an list of parameter names for which a change should cause the setupCompleteChanged
/// signal to be emitted. Last element is signalled by NULL.
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
=
0
;
/// Should be called after the component is created (but not in constructor) to setup the
/// signals which are used to track parameter changes which affect setupComplete state.
void
setupTriggerSignals
(
void
);
private
slots
:
void
_triggerUpdated
(
QVariant
value
);
};
#endif
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