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
f08d592f
Commit
f08d592f
authored
Dec 23, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new _autopilot member
parent
76e8afff
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
40 additions
and
28 deletions
+40
-28
AirframeComponent.cc
src/AutoPilotPlugins/PX4/AirframeComponent.cc
+2
-2
AirframeComponent.h
src/AutoPilotPlugins/PX4/AirframeComponent.h
+1
-1
FlightModesComponent.cc
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
+2
-2
FlightModesComponent.h
src/AutoPilotPlugins/PX4/FlightModesComponent.h
+1
-1
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+9
-4
PX4Component.cc
src/AutoPilotPlugins/PX4/PX4Component.cc
+2
-2
PX4Component.h
src/AutoPilotPlugins/PX4/PX4Component.h
+1
-2
RadioComponent.cc
src/AutoPilotPlugins/PX4/RadioComponent.cc
+2
-2
RadioComponent.h
src/AutoPilotPlugins/PX4/RadioComponent.h
+1
-1
SensorsComponent.cc
src/AutoPilotPlugins/PX4/SensorsComponent.cc
+2
-2
SensorsComponent.h
src/AutoPilotPlugins/PX4/SensorsComponent.h
+1
-1
VehicleComponent.cc
src/VehicleSetup/VehicleComponent.cc
+7
-2
VehicleComponent.h
src/VehicleSetup/VehicleComponent.h
+9
-6
No files found.
src/AutoPilotPlugins/PX4/AirframeComponent.cc
View file @
f08d592f
...
...
@@ -62,8 +62,8 @@ static const struct mavType mavTypeInfo[] = {
};
static
size_t
cMavTypes
=
sizeof
(
mavTypeInfo
)
/
sizeof
(
mavTypeInfo
[
0
]);
AirframeComponent
::
AirframeComponent
(
UASInterface
*
uas
,
QObject
*
parent
)
:
PX4Component
(
uas
,
parent
),
AirframeComponent
::
AirframeComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Airframe"
))
{
// Validate that our mavTypeInfo array hasn't gotten out of sync
...
...
src/AutoPilotPlugins/PX4/AirframeComponent.h
View file @
f08d592f
...
...
@@ -35,7 +35,7 @@ class AirframeComponent : public PX4Component
Q_OBJECT
public:
AirframeComponent
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
AirframeComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
View file @
f08d592f
...
...
@@ -45,8 +45,8 @@ static const SwitchListItem switchList[] = {
};
static
const
size_t
cSwitchList
=
sizeof
(
switchList
)
/
sizeof
(
switchList
[
0
]);
FlightModesComponent
::
FlightModesComponent
(
UASInterface
*
uas
,
QObject
*
parent
)
:
PX4Component
(
uas
,
parent
),
FlightModesComponent
::
FlightModesComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Flight Modes"
))
{
}
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.h
View file @
f08d592f
...
...
@@ -35,7 +35,7 @@ class FlightModesComponent : public PX4Component
Q_OBJECT
public:
FlightModesComponent
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
FlightModesComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
f08d592f
...
...
@@ -26,6 +26,7 @@
#include "RadioComponent.h"
#include "SensorsComponent.h"
#include "FlightModesComponent.h"
#include "SafetyComponent.h"
#include "AutoPilotPluginManager.h"
#include "UASManager.h"
#include "QGCUASParamManagerInterface.h"
...
...
@@ -196,19 +197,23 @@ const QVariantList& PX4AutoPilotPlugin::components(void)
Q_ASSERT
(
_uas
);
component
=
new
AirframeComponent
(
_uas
);
component
=
new
AirframeComponent
(
_uas
,
this
);
Q_CHECK_PTR
(
component
);
_components
.
append
(
QVariant
::
fromValue
(
component
));
component
=
new
RadioComponent
(
_uas
);
component
=
new
RadioComponent
(
_uas
,
this
);
Q_CHECK_PTR
(
component
);
_components
.
append
(
QVariant
::
fromValue
(
component
));
component
=
new
FlightModesComponent
(
_uas
);
component
=
new
FlightModesComponent
(
_uas
,
this
);
Q_CHECK_PTR
(
component
);
_components
.
append
(
QVariant
::
fromValue
(
component
));
component
=
new
SensorsComponent
(
_uas
);
component
=
new
SensorsComponent
(
_uas
,
this
);
Q_CHECK_PTR
(
component
);
_components
.
append
(
QVariant
::
fromValue
(
component
));
component
=
new
SafetyComponent
(
_uas
,
this
);
Q_CHECK_PTR
(
component
);
_components
.
append
(
QVariant
::
fromValue
(
component
));
}
...
...
src/AutoPilotPlugins/PX4/PX4Component.cc
View file @
f08d592f
...
...
@@ -26,8 +26,8 @@
#include "PX4Component.h"
PX4Component
::
PX4Component
(
UASInterface
*
uas
,
QObject
*
parent
)
:
VehicleComponent
(
uas
,
parent
)
PX4Component
::
PX4Component
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
VehicleComponent
(
uas
,
autopilot
,
parent
)
{
bool
fSuccess
=
connect
(
_paramMgr
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
this
,
SLOT
(
_parameterUpdated
(
int
,
QString
,
QVariant
)));
Q_ASSERT
(
fSuccess
);
...
...
src/AutoPilotPlugins/PX4/PX4Component.h
View file @
f08d592f
...
...
@@ -35,7 +35,7 @@ class PX4Component : public VehicleComponent
Q_OBJECT
public:
PX4Component
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
PX4Component
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
/// @brief Returns an array of parameter names for which a change should cause the setupCompleteChanged
/// signal to be emitted. Last element is signalled by NULL. Must be implemented by upper level class.
...
...
@@ -45,7 +45,6 @@ private slots:
/// @brief Connected to QGCUASParamManagerInterface::parameterUpdated signal in order to signal
/// setupCompleteChanged at appropriate times.
void
_parameterUpdated
(
int
compId
,
QString
paramName
,
QVariant
value
);
};
#endif
src/AutoPilotPlugins/PX4/RadioComponent.cc
View file @
f08d592f
...
...
@@ -31,8 +31,8 @@
/// @brief Parameters which signal a change in setupComplete state
static
const
char
*
triggerParams
[]
=
{
"RC_MAP_MODE_SW"
,
NULL
};
RadioComponent
::
RadioComponent
(
UASInterface
*
uas
,
QObject
*
parent
)
:
PX4Component
(
uas
,
parent
),
RadioComponent
::
RadioComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Radio"
))
{
}
...
...
src/AutoPilotPlugins/PX4/RadioComponent.h
View file @
f08d592f
...
...
@@ -36,7 +36,7 @@ class RadioComponent : public PX4Component
Q_OBJECT
public:
RadioComponent
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
RadioComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.cc
View file @
f08d592f
...
...
@@ -36,8 +36,8 @@ static const char* triggerParams[] = { "SENS_MAG_XOFF", "SENS_GYRO_XOFF", "SENS
/// @brief Used to translate from parameter name to user string
static
const
char
*
triggerSensors
[]
=
{
"Compass"
,
"Gyro"
,
"Acceleromter"
,
"Airspeed"
,
NULL
};
SensorsComponent
::
SensorsComponent
(
UASInterface
*
uas
,
QObject
*
parent
)
:
PX4Component
(
uas
,
parent
),
SensorsComponent
::
SensorsComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Sensors"
))
{
}
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.h
View file @
f08d592f
...
...
@@ -35,7 +35,7 @@ class SensorsComponent : public PX4Component
Q_OBJECT
public:
SensorsComponent
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
SensorsComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
...
...
src/VehicleSetup/VehicleComponent.cc
View file @
f08d592f
...
...
@@ -25,13 +25,18 @@
/// @author Don Gagne <don@thegagnes.com>
#include "VehicleComponent.h"
#include "AutoPilotPlugin.h"
VehicleComponent
::
VehicleComponent
(
UASInterface
*
uas
,
QObject
*
parent
)
:
VehicleComponent
::
VehicleComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
QObject
(
parent
),
_uas
(
uas
),
_
paramMgr
(
_uas
->
getParamManager
()
)
_
autopilot
(
autopilot
)
{
Q_ASSERT
(
uas
);
Q_ASSERT
(
autopilot
);
_paramMgr
=
_uas
->
getParamManager
();
Q_ASSERT
(
_paramMgr
);
}
VehicleComponent
::~
VehicleComponent
()
...
...
src/VehicleSetup/VehicleComponent.h
View file @
f08d592f
...
...
@@ -21,6 +21,9 @@
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#ifndef VEHICLECOMPONENT_H
#define VEHICLECOMPONENT_H
...
...
@@ -30,11 +33,10 @@
#include "UASInterface.h"
/// @file
/// @brief Vehicle Component class. A vehicle component is an object which
/// abstracts the physical portion of a vehicle into a set of
/// configurable values and user interface.
/// @author Don Gagne <don@thegagnes.com>
class
AutoPilotPlugin
;
/// A vehicle component is an object which abstracts the physical portion of a vehicle into a set of
/// configurable values and user interface.
class
VehicleComponent
:
public
QObject
{
...
...
@@ -50,7 +52,7 @@ class VehicleComponent : public QObject
Q_PROPERTY
(
QVariantList
summaryItems
READ
summaryItems
CONSTANT
);
public:
VehicleComponent
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
VehicleComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
~
VehicleComponent
();
virtual
QString
name
(
void
)
const
=
0
;
...
...
@@ -70,6 +72,7 @@ signals:
protected:
UASInterface
*
_uas
;
AutoPilotPlugin
*
_autopilot
;
QGCUASParamManagerInterface
*
_paramMgr
;
};
...
...
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