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
3e5cd898
Commit
3e5cd898
authored
Feb 01, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making the ESP8266 component "common" instead of APM/PX4 only.
parent
bb93217c
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
125 additions
and
303 deletions
+125
-303
qgroundcontrol.pro
qgroundcontrol.pro
+2
-6
APMAirframeComponent.cc
src/AutoPilotPlugins/APM/APMAirframeComponent.cc
+1
-1
APMAirframeComponent.h
src/AutoPilotPlugins/APM/APMAirframeComponent.h
+3
-3
APMAutoPilotPlugin.cc
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
+11
-1
APMAutoPilotPlugin.h
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
+3
-0
APMCameraComponent.cc
src/AutoPilotPlugins/APM/APMCameraComponent.cc
+1
-1
APMCameraComponent.h
src/AutoPilotPlugins/APM/APMCameraComponent.h
+3
-3
APMComponent.cc
src/AutoPilotPlugins/APM/APMComponent.cc
+0
-51
APMComponent.h
src/AutoPilotPlugins/APM/APMComponent.h
+0
-54
APMFlightModesComponent.cc
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc
+1
-1
APMFlightModesComponent.h
src/AutoPilotPlugins/APM/APMFlightModesComponent.h
+3
-3
APMPowerComponent.cc
src/AutoPilotPlugins/APM/APMPowerComponent.cc
+1
-1
APMPowerComponent.h
src/AutoPilotPlugins/APM/APMPowerComponent.h
+3
-3
APMRadioComponent.cc
src/AutoPilotPlugins/APM/APMRadioComponent.cc
+1
-1
APMRadioComponent.h
src/AutoPilotPlugins/APM/APMRadioComponent.h
+3
-3
APMSafetyComponent.cc
src/AutoPilotPlugins/APM/APMSafetyComponent.cc
+1
-1
APMSafetyComponent.h
src/AutoPilotPlugins/APM/APMSafetyComponent.h
+3
-3
APMSensorsComponent.cc
src/AutoPilotPlugins/APM/APMSensorsComponent.cc
+1
-1
APMSensorsComponent.h
src/AutoPilotPlugins/APM/APMSensorsComponent.h
+3
-3
APMTuningComponent.cc
src/AutoPilotPlugins/APM/APMTuningComponent.cc
+1
-1
APMTuningComponent.h
src/AutoPilotPlugins/APM/APMTuningComponent.h
+3
-3
ESP8266Component.cc
src/AutoPilotPlugins/Common/ESP8266Component.cc
+13
-13
ESP8266Component.h
src/AutoPilotPlugins/Common/ESP8266Component.h
+6
-6
AirframeComponent.cc
src/AutoPilotPlugins/PX4/AirframeComponent.cc
+1
-1
AirframeComponent.h
src/AutoPilotPlugins/PX4/AirframeComponent.h
+3
-3
FlightModesComponent.cc
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
+1
-1
FlightModesComponent.h
src/AutoPilotPlugins/PX4/FlightModesComponent.h
+3
-3
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+1
-1
PX4AutoPilotPlugin.h
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
+3
-3
PX4Component.cc
src/AutoPilotPlugins/PX4/PX4Component.cc
+0
-53
PX4Component.h
src/AutoPilotPlugins/PX4/PX4Component.h
+0
-54
PX4RadioComponent.cc
src/AutoPilotPlugins/PX4/PX4RadioComponent.cc
+1
-1
PX4RadioComponent.h
src/AutoPilotPlugins/PX4/PX4RadioComponent.h
+3
-3
PX4TuningComponent.cc
src/AutoPilotPlugins/PX4/PX4TuningComponent.cc
+1
-1
PX4TuningComponent.h
src/AutoPilotPlugins/PX4/PX4TuningComponent.h
+3
-3
PowerComponent.cc
src/AutoPilotPlugins/PX4/PowerComponent.cc
+1
-1
PowerComponent.h
src/AutoPilotPlugins/PX4/PowerComponent.h
+3
-3
SafetyComponent.cc
src/AutoPilotPlugins/PX4/SafetyComponent.cc
+1
-1
SafetyComponent.h
src/AutoPilotPlugins/PX4/SafetyComponent.h
+3
-3
SensorsComponent.cc
src/AutoPilotPlugins/PX4/SensorsComponent.cc
+1
-1
SensorsComponent.h
src/AutoPilotPlugins/PX4/SensorsComponent.h
+3
-3
VehicleComponent.cc
src/VehicleSetup/VehicleComponent.cc
+14
-0
VehicleComponent.h
src/VehicleSetup/VehicleComponent.h
+12
-1
No files found.
qgroundcontrol.pro
View file @
3e5cd898
...
...
@@ -562,7 +562,6 @@ HEADERS+= \
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentAirframes
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMCameraComponent
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMCompassCal
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMComponent
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMFlightModesComponent
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMFlightModesComponentController
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMPowerComponent
.
h
\
...
...
@@ -573,6 +572,7 @@ HEADERS+= \
src
/
AutoPilotPlugins
/
APM
/
APMTuningComponent
.
h
\
src
/
AutoPilotPlugins
/
Common
/
RadioComponentController
.
h
\
src
/
AutoPilotPlugins
/
Common
/
ESP8266ComponentController
.
h
\
src
/
AutoPilotPlugins
/
Common
/
ESP8266Component
.
h
\
src
/
AutoPilotPlugins
/
Generic
/
GenericAutoPilotPlugin
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponent
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponentAirframes
.
h
\
...
...
@@ -582,9 +582,7 @@ HEADERS+= \
src
/
AutoPilotPlugins
/
PX4
/
PowerComponent
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
PowerComponentController
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
PX4AutoPilotPlugin
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
PX4Component
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
PX4RadioComponent
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
PX4ESP8266Component
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
SafetyComponent
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
SensorsComponent
.
h
\
src
/
AutoPilotPlugins
/
PX4
/
SensorsComponentController
.
h
\
...
...
@@ -620,7 +618,6 @@ SOURCES += \
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentController
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMCameraComponent
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMCompassCal
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMComponent
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMFlightModesComponent
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMFlightModesComponentController
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMPowerComponent
.
cc
\
...
...
@@ -631,6 +628,7 @@ SOURCES += \
src
/
AutoPilotPlugins
/
APM
/
APMTuningComponent
.
cc
\
src
/
AutoPilotPlugins
/
Common
/
RadioComponentController
.
cc
\
src
/
AutoPilotPlugins
/
Common
/
ESP8266ComponentController
.
cc
\
src
/
AutoPilotPlugins
/
Common
/
ESP8266Component
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentAirframes
.
cc
\
src
/
AutoPilotPlugins
/
Generic
/
GenericAutoPilotPlugin
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
AirframeComponent
.
cc
\
...
...
@@ -641,9 +639,7 @@ SOURCES += \
src
/
AutoPilotPlugins
/
PX4
/
PowerComponent
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
PowerComponentController
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
PX4AutoPilotPlugin
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
PX4Component
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
PX4RadioComponent
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
PX4ESP8266Component
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
SafetyComponent
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
SensorsComponent
.
cc
\
src
/
AutoPilotPlugins
/
PX4
/
SensorsComponentController
.
cc
\
...
...
src/AutoPilotPlugins/APM/APMAirframeComponent.cc
View file @
3e5cd898
...
...
@@ -28,7 +28,7 @@
#include "ArduCopterFirmwarePlugin.h"
APMAirframeComponent
::
APMAirframeComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
)
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
)
,
_requiresFrameSetup
(
false
)
,
_name
(
"Airframe"
)
{
...
...
src/AutoPilotPlugins/APM/APMAirframeComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef APMAirframeComponent_H
#define APMAirframeComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMAirframeComponent
:
public
APM
Component
class
APMAirframeComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMAirframeComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
APM
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
3e5cd898
...
...
@@ -27,7 +27,7 @@
#include "FirmwarePlugin/APM/APMParameterMetaData.h" // FIXME: Hack
#include "FirmwarePlugin/APM/APMFirmwarePlugin.h" // FIXME: Hack
#include "FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h"
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
#include "APMAirframeComponent.h"
#include "APMAirframeComponentAirframes.h"
#include "APMAirframeComponentController.h"
...
...
@@ -40,6 +40,7 @@
#include "APMSensorsComponent.h"
#include "APMPowerComponent.h"
#include "APMCameraComponent.h"
#include "ESP8266Component.h"
/// This is the AutoPilotPlugin implementatin for the MAV_AUTOPILOT_ARDUPILOT type.
APMAutoPilotPlugin
::
APMAutoPilotPlugin
(
Vehicle
*
vehicle
,
QObject
*
parent
)
...
...
@@ -54,6 +55,7 @@ APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
,
_sensorsComponent
(
NULL
)
,
_tuningComponent
(
NULL
)
,
_airframeFacts
(
new
APMAirframeLoader
(
this
,
vehicle
->
uas
(),
this
))
,
_esp8266Component
(
NULL
)
{
APMAirframeLoader
::
loadAirframeFactMetaData
();
}
...
...
@@ -89,6 +91,13 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_radioComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_radioComponent
));
//-- Is there an ESP8266 Connected?
if
(
factExists
(
FactSystem
::
ParameterProvider
,
MAV_COMP_ID_UDP_BRIDGE
,
"SW_VER"
))
{
_esp8266Component
=
new
ESP8266Component
(
_vehicle
,
this
);
_esp8266Component
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_esp8266Component
));
}
_sensorsComponent
=
new
APMSensorsComponent
(
_vehicle
,
this
);
_sensorsComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_sensorsComponent
));
...
...
@@ -100,6 +109,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_tuningComponent
=
new
APMTuningComponent
(
_vehicle
,
this
);
_tuningComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_tuningComponent
));
}
else
{
qWarning
()
<<
"Call to vehicleCompenents prior to parametersReady"
;
}
...
...
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
View file @
3e5cd898
...
...
@@ -36,6 +36,7 @@ class APMSafetyComponent;
class
APMSensorsComponent
;
class
APMPowerComponent
;
class
APMCameraComponent
;
class
ESP8266Component
;
/// This is the APM specific implementation of the AutoPilot class.
class
APMAutoPilotPlugin
:
public
AutoPilotPlugin
...
...
@@ -57,6 +58,7 @@ public:
APMSafetyComponent
*
safetyComponent
(
void
)
const
{
return
_safetyComponent
;
}
APMSensorsComponent
*
sensorsComponent
(
void
)
const
{
return
_sensorsComponent
;
}
APMTuningComponent
*
tuningComponent
(
void
)
const
{
return
_tuningComponent
;
}
ESP8266Component
*
esp8266Component
(
void
)
const
{
return
_esp8266Component
;
}
public
slots
:
// FIXME: This is public until we restructure AutoPilotPlugin/FirmwarePlugin/Vehicle
...
...
@@ -75,6 +77,7 @@ private:
APMSensorsComponent
*
_sensorsComponent
;
APMTuningComponent
*
_tuningComponent
;
APMAirframeLoader
*
_airframeFacts
;
ESP8266Component
*
_esp8266Component
;
};
#endif
src/AutoPilotPlugins/APM/APMCameraComponent.cc
View file @
3e5cd898
...
...
@@ -30,7 +30,7 @@
#include "APMAirframeComponent.h"
APMCameraComponent
::
APMCameraComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
)
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
)
,
_name
(
tr
(
"Camera"
))
{
}
...
...
src/AutoPilotPlugins/APM/APMCameraComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef APMCameraComponent_H
#define APMCameraComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMCameraComponent
:
public
APM
Component
class
APMCameraComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMCameraComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMComponent.cc
deleted
100644 → 0
View file @
bb93217c
/*=====================================================================
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
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
VehicleComponent
(
vehicle
,
autopilot
,
parent
)
{
Q_ASSERT
(
vehicle
);
Q_ASSERT
(
autopilot
);
}
void
APMComponent
::
setupTriggerSignals
(
void
)
{
foreach
(
const
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
deleted
100644 → 0
View file @
bb93217c
/*=====================================================================
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
(
Vehicle
*
vehicle
,
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
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc
View file @
3e5cd898
...
...
@@ -27,7 +27,7 @@
#include "APMRadioComponent.h"
APMFlightModesComponent
::
APMFlightModesComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Flight Modes"
))
{
}
...
...
src/AutoPilotPlugins/APM/APMFlightModesComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef APMFlightModesComponent_H
#define APMFlightModesComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMFlightModesComponent
:
public
APM
Component
class
APMFlightModesComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMFlightModesComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMPowerComponent.cc
View file @
3e5cd898
...
...
@@ -26,7 +26,7 @@
#include "APMAirframeComponent.h"
APMPowerComponent
::
APMPowerComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
),
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
"Power"
)
{
}
...
...
src/AutoPilotPlugins/APM/APMPowerComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef APMPowerComponent_H
#define APMPowerComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMPowerComponent
:
public
APM
Component
class
APMPowerComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMPowerComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMRadioComponent.cc
View file @
3e5cd898
...
...
@@ -26,7 +26,7 @@
#include "APMAirframeComponent.h"
APMRadioComponent
::
APMRadioComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Radio"
))
{
_mapParams
<<
QStringLiteral
(
"RCMAP_ROLL"
)
<<
QStringLiteral
(
"RCMAP_PITCH"
)
<<
QStringLiteral
(
"RCMAP_YAW"
)
<<
QStringLiteral
(
"RCMAP_THROTTLE"
);
...
...
src/AutoPilotPlugins/APM/APMRadioComponent.h
View file @
3e5cd898
...
...
@@ -24,17 +24,17 @@
#ifndef APMRadioComponent_H
#define APMRadioComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
#include "Fact.h"
class
APMRadioComponent
:
public
APM
Component
class
APMRadioComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMRadioComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMSafetyComponent.cc
View file @
3e5cd898
...
...
@@ -30,7 +30,7 @@
#include "APMAirframeComponent.h"
APMSafetyComponent
::
APMSafetyComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
)
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
)
,
_name
(
tr
(
"Safety"
))
{
}
...
...
src/AutoPilotPlugins/APM/APMSafetyComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef APMSafetyComponent_H
#define APMSafetyComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMSafetyComponent
:
public
APM
Component
class
APMSafetyComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMSafetyComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMSensorsComponent.cc
View file @
3e5cd898
...
...
@@ -29,7 +29,7 @@
// These two list must be kept in sync
APMSensorsComponent
::
APMSensorsComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Sensors"
))
{
...
...
src/AutoPilotPlugins/APM/APMSensorsComponent.h
View file @
3e5cd898
...
...
@@ -24,9 +24,9 @@
#ifndef APMSensorsComponent_H
#define APMSensorsComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMSensorsComponent
:
public
APM
Component
class
APMSensorsComponent
:
public
Vehicle
Component
{
Q_OBJECT
...
...
@@ -36,7 +36,7 @@ public:
bool
compassSetupNeeded
(
void
)
const
;
bool
accelSetupNeeded
(
void
)
const
;
// Virtuals from
APM
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/APM/APMTuningComponent.cc
View file @
3e5cd898
...
...
@@ -26,7 +26,7 @@
#include "APMAirframeComponent.h"
APMTuningComponent
::
APMTuningComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
APM
Component
(
vehicle
,
autopilot
,
parent
)
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
)
,
_name
(
"Tuning"
)
{
}
...
...
src/AutoPilotPlugins/APM/APMTuningComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef APMTuningComponent_H
#define APMTuningComponent_H
#include "
APM
Component.h"
#include "
Vehicle
Component.h"
class
APMTuningComponent
:
public
APM
Component
class
APMTuningComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
APMTuningComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
(
void
)
const
final
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/
PX4/PX4
ESP8266Component.cc
→
src/AutoPilotPlugins/
Common/
ESP8266Component.cc
View file @
3e5cd898
...
...
@@ -21,57 +21,57 @@
======================================================================*/
#include "
PX4
ESP8266Component.h"
#include "
PX4
AutoPilotPlugin.h"
#include "ESP8266Component.h"
#include "AutoPilotPlugin.h"
PX4ESP8266Component
::
PX4
ESP8266Component
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
)
ESP8266Component
::
ESP8266Component
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
)
,
_name
(
tr
(
"WiFi Bridge"
))
{
}
QString
PX4
ESP8266Component
::
name
(
void
)
const
QString
ESP8266Component
::
name
(
void
)
const
{
return
_name
;
}
QString
PX4
ESP8266Component
::
description
(
void
)
const
QString
ESP8266Component
::
description
(
void
)
const
{
return
tr
(
"The ESP8266 WiFi Bridge Component is used to setup the WiFi link."
);
}
QString
PX4
ESP8266Component
::
iconResource
(
void
)
const
QString
ESP8266Component
::
iconResource
(
void
)
const
{
return
"/qmlimages/wifi.svg"
;
}
bool
PX4
ESP8266Component
::
requiresSetup
(
void
)
const
bool
ESP8266Component
::
requiresSetup
(
void
)
const
{
return
false
;
}
bool
PX4
ESP8266Component
::
setupComplete
(
void
)
const
bool
ESP8266Component
::
setupComplete
(
void
)
const
{
return
true
;
}
QStringList
PX4
ESP8266Component
::
setupCompleteChangedTriggerList
(
void
)
const
QStringList
ESP8266Component
::
setupCompleteChangedTriggerList
(
void
)
const
{
return
QStringList
();
}
QUrl
PX4
ESP8266Component
::
setupSource
(
void
)
const
QUrl
ESP8266Component
::
setupSource
(
void
)
const
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/ESP8266Component.qml"
);
}
QUrl
PX4
ESP8266Component
::
summaryQmlSource
(
void
)
const
QUrl
ESP8266Component
::
summaryQmlSource
(
void
)
const
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/ESP8266ComponentSummary.qml"
);
}
QString
PX4
ESP8266Component
::
prerequisiteSetup
(
void
)
const
QString
ESP8266Component
::
prerequisiteSetup
(
void
)
const
{
return
QString
();
}
src/AutoPilotPlugins/
PX4/PX4
ESP8266Component.h
→
src/AutoPilotPlugins/
Common/
ESP8266Component.h
View file @
3e5cd898
...
...
@@ -21,18 +21,18 @@
======================================================================*/
#ifndef
PX4
ESP8266Component_H
#define
PX4
ESP8266Component_H
#ifndef ESP8266Component_H
#define ESP8266Component_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
class
PX4ESP8266Component
:
public
PX4
Component
class
ESP8266Component
:
public
Vehicle
Component
{
Q_OBJECT
public:
PX4ESP8266Component
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
ESP8266Component
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
QStringList
setupCompleteChangedTriggerList
()
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/AirframeComponent.cc
View file @
3e5cd898
...
...
@@ -69,7 +69,7 @@ static size_t cMavTypes = sizeof(mavTypeInfo) / sizeof(mavTypeInfo[0]);
#endif
AirframeComponent
::
AirframeComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Airframe"
))
{
#if 0
...
...
src/AutoPilotPlugins/PX4/AirframeComponent.h
View file @
3e5cd898
...
...
@@ -24,20 +24,20 @@
#ifndef AIRFRAMECOMPONENT_H
#define AIRFRAMECOMPONENT_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
/// @file
/// @brief The Airframe VehicleComponent is used to set the SYS_AUTOSTART airframe id.
/// @author Don Gagne <don@thegagnes.com>
class
AirframeComponent
:
public
PX4
Component
class
AirframeComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
AirframeComponent
(
Vehicle
*
vehicles
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
View file @
3e5cd898
...
...
@@ -34,7 +34,7 @@ struct SwitchListItem {
};
FlightModesComponent
::
FlightModesComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Flight Modes"
))
{
}
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.h
View file @
3e5cd898
...
...
@@ -24,20 +24,20 @@
#ifndef FLIGHTMODESCOMPONENT_H
#define FLIGHTMODESCOMPONENT_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
/// @file
/// @brief The FlightModes VehicleComponent is used to set the associated Flight Mode switches.
/// @author Don Gagne <don@thegagnes.com>
class
FlightModesComponent
:
public
PX4
Component
class
FlightModesComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
FlightModesComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
3e5cd898
...
...
@@ -105,7 +105,7 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void)
//-- Is there an ESP8266 Connected?
if
(
factExists
(
FactSystem
::
ParameterProvider
,
MAV_COMP_ID_UDP_BRIDGE
,
"SW_VER"
))
{
_esp8266Component
=
new
PX4
ESP8266Component
(
_vehicle
,
this
);
_esp8266Component
=
new
ESP8266Component
(
_vehicle
,
this
);
_esp8266Component
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_esp8266Component
));
}
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
View file @
3e5cd898
...
...
@@ -28,7 +28,7 @@
#include "PX4AirframeLoader.h"
#include "AirframeComponent.h"
#include "PX4RadioComponent.h"
#include "
PX4
ESP8266Component.h"
#include "ESP8266Component.h"
#include "FlightModesComponent.h"
#include "SensorsComponent.h"
#include "SafetyComponent.h"
...
...
@@ -56,7 +56,7 @@ public:
// These methods should only be used by objects within the plugin
AirframeComponent
*
airframeComponent
(
void
)
{
return
_airframeComponent
;
}
PX4RadioComponent
*
radioComponent
(
void
)
{
return
_radioComponent
;
}
PX4ESP8266Component
*
esp8266Component
(
void
)
{
return
_esp8266Component
;
}
ESP8266Component
*
esp8266Component
(
void
)
{
return
_esp8266Component
;
}
FlightModesComponent
*
flightModesComponent
(
void
)
{
return
_flightModesComponent
;
}
SensorsComponent
*
sensorsComponent
(
void
)
{
return
_sensorsComponent
;
}
SafetyComponent
*
safetyComponent
(
void
)
{
return
_safetyComponent
;
}
...
...
@@ -72,7 +72,7 @@ private:
QVariantList
_components
;
AirframeComponent
*
_airframeComponent
;
PX4RadioComponent
*
_radioComponent
;
PX4ESP8266Component
*
_esp8266Component
;
ESP8266Component
*
_esp8266Component
;
FlightModesComponent
*
_flightModesComponent
;
SensorsComponent
*
_sensorsComponent
;
SafetyComponent
*
_safetyComponent
;
...
...
src/AutoPilotPlugins/PX4/PX4Component.cc
deleted
100644 → 0
View file @
bb93217c
/*=====================================================================
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 "PX4Component.h"
#include "Fact.h"
#include "AutoPilotPlugin.h"
PX4Component
::
PX4Component
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
VehicleComponent
(
vehicle
,
autopilot
,
parent
)
{
Q_ASSERT
(
vehicle
);
Q_ASSERT
(
autopilot
);
}
void
PX4Component
::
setupTriggerSignals
(
void
)
{
// Watch for changed on trigger list params
foreach
(
const
QString
&
paramName
,
setupCompleteChangedTriggerList
())
{
Fact
*
fact
=
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
paramName
);
connect
(
fact
,
&
Fact
::
valueChanged
,
this
,
&
PX4Component
::
_triggerUpdated
);
}
}
void
PX4Component
::
_triggerUpdated
(
QVariant
value
)
{
Q_UNUSED
(
value
);
emit
setupCompleteChanged
(
setupComplete
());
}
src/AutoPilotPlugins/PX4/PX4Component.h
deleted
100644 → 0
View file @
bb93217c
/*=====================================================================
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 PX4COMPONENT_H
#define PX4COMPONENT_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
PX4Component
:
public
VehicleComponent
{
Q_OBJECT
public:
PX4Component
(
Vehicle
*
vehicle
,
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
src/AutoPilotPlugins/PX4/PX4RadioComponent.cc
View file @
3e5cd898
...
...
@@ -25,7 +25,7 @@
#include "PX4AutoPilotPlugin.h"
PX4RadioComponent
::
PX4RadioComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Radio"
))
{
}
...
...
src/AutoPilotPlugins/PX4/PX4RadioComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef PX4RadioComponent_H
#define PX4RadioComponent_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
class
PX4RadioComponent
:
public
PX4
Component
class
PX4RadioComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
PX4RadioComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/PX4TuningComponent.cc
View file @
3e5cd898
...
...
@@ -26,7 +26,7 @@
#include "AirframeComponent.h"
PX4TuningComponent
::
PX4TuningComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
)
:
Vehicle
Component
(
vehicle
,
autopilot
,
parent
)
,
_name
(
"Tuning"
)
{
}
...
...
src/AutoPilotPlugins/PX4/PX4TuningComponent.h
View file @
3e5cd898
...
...
@@ -24,16 +24,16 @@
#ifndef PX4TuningComponent_H
#define PX4TuningComponent_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
class
PX4TuningComponent
:
public
PX4
Component
class
PX4TuningComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
PX4TuningComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/PowerComponent.cc
View file @
3e5cd898
...
...
@@ -29,7 +29,7 @@
#include "PX4AutoPilotPlugin.h"
PowerComponent
::
PowerComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Power"
))
{
}
...
...
src/AutoPilotPlugins/PX4/PowerComponent.h
View file @
3e5cd898
...
...
@@ -24,20 +24,20 @@
#ifndef PowerComponent_H
#define PowerComponent_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
/// @file
/// @brief Battery, propeller and magnetometer settings
/// @author Gus Grubba <mavlink@grubba.com>
class
PowerComponent
:
public
PX4
Component
class
PowerComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
PowerComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.cc
View file @
3e5cd898
...
...
@@ -28,7 +28,7 @@
#include "PX4AutoPilotPlugin.h"
SafetyComponent
::
SafetyComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Safety"
))
{
}
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.h
View file @
3e5cd898
...
...
@@ -24,21 +24,21 @@
#ifndef SafetyComponent_H
#define SafetyComponent_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
/// @file
/// @brief The Radio VehicleComponent is used to calibrate the trasmitter and assign function mapping
/// to channels.
/// @author Don Gagne <don@thegagnes.com>
class
SafetyComponent
:
public
PX4
Component
class
SafetyComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
SafetyComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.cc
View file @
3e5cd898
...
...
@@ -32,7 +32,7 @@
// These two list must be kept in sync
SensorsComponent
::
SensorsComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4
Component
(
vehicle
,
autopilot
,
parent
),
Vehicle
Component
(
vehicle
,
autopilot
,
parent
),
_name
(
tr
(
"Sensors"
))
{
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.h
View file @
3e5cd898
...
...
@@ -24,20 +24,20 @@
#ifndef SENSORSCOMPONENT_H
#define SENSORSCOMPONENT_H
#include "
PX4
Component.h"
#include "
Vehicle
Component.h"
/// @file
/// @brief The Sensors VehicleComponent is used to calibrate the the various sensors associated with the board.
/// @author Don Gagne <don@thegagnes.com>
class
SensorsComponent
:
public
PX4
Component
class
SensorsComponent
:
public
Vehicle
Component
{
Q_OBJECT
public:
SensorsComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from
PX4
Component
// Virtuals from
Vehicle
Component
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
...
...
src/VehicleSetup/VehicleComponent.cc
View file @
3e5cd898
...
...
@@ -57,3 +57,17 @@ void VehicleComponent::addSummaryQmlComponent(QQmlContext* context, QQuickItem*
item
->
setParentItem
(
parent
);
item
->
setProperty
(
"vehicleComponent"
,
QVariant
::
fromValue
(
this
));
}
void
VehicleComponent
::
setupTriggerSignals
(
void
)
{
// Watch for changed on trigger list params
foreach
(
const
QString
&
paramName
,
setupCompleteChangedTriggerList
())
{
Fact
*
fact
=
_autopilot
->
getParameterFact
(
FactSystem
::
defaultComponentId
,
paramName
);
connect
(
fact
,
&
Fact
::
valueChanged
,
this
,
&
VehicleComponent
::
_triggerUpdated
);
}
}
void
VehicleComponent
::
_triggerUpdated
(
QVariant
/*value*/
)
{
emit
setupCompleteChanged
(
setupComplete
());
}
src/VehicleSetup/VehicleComponent.h
View file @
3e5cd898
...
...
@@ -66,9 +66,20 @@ public:
virtual
void
addSummaryQmlComponent
(
QQmlContext
*
context
,
QQuickItem
*
parent
);
/// @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.
virtual
void
setupTriggerSignals
(
void
);
signals:
void
setupCompleteChanged
(
bool
setupComplete
);
protected
slots
:
void
_triggerUpdated
(
QVariant
value
);
protected:
Vehicle
*
_vehicle
;
AutoPilotPlugin
*
_autopilot
;
...
...
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