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
4b128fba
Commit
4b128fba
authored
Mar 29, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for FactLoader->ParameterLoader changes
parent
59856660
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
53 deletions
+33
-53
GenericAutoPilotPlugin.cc
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.cc
+3
-13
GenericAutoPilotPlugin.h
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h
+3
-4
GenericParameterFacts.cc
src/AutoPilotPlugins/Generic/GenericParameterFacts.cc
+1
-3
GenericParameterFacts.h
src/AutoPilotPlugins/Generic/GenericParameterFacts.h
+5
-5
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+4
-14
PX4AutoPilotPlugin.h
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
+8
-9
PX4ParameterFacts.cc
src/AutoPilotPlugins/PX4/PX4ParameterFacts.cc
+2
-2
PX4ParameterFacts.h
src/AutoPilotPlugins/PX4/PX4ParameterFacts.h
+7
-3
No files found.
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.cc
View file @
4b128fba
...
...
@@ -34,7 +34,7 @@ GenericAutoPilotPlugin::GenericAutoPilotPlugin(UASInterface* uas, QObject* paren
_parameterFacts
=
new
GenericParameterFacts
(
uas
,
this
);
Q_CHECK_PTR
(
_parameterFacts
);
connect
(
_parameterFacts
,
&
GenericParameterFacts
::
factsReady
,
this
,
&
GenericAutoPilotPlugin
::
_fact
sReady
);
connect
(
_parameterFacts
,
&
GenericParameterFacts
::
parametersReady
,
this
,
&
GenericAutoPilotPlugin
::
_parameter
sReady
);
}
QList
<
AutoPilotPluginManager
::
FullMode_t
>
GenericAutoPilotPlugin
::
getModes
(
void
)
...
...
@@ -87,24 +87,14 @@ void GenericAutoPilotPlugin::clearStaticData(void)
// No Static data yet
}
const
QVariantList
&
GenericAutoPilotPlugin
::
c
omponents
(
void
)
const
QVariantList
&
GenericAutoPilotPlugin
::
vehicleC
omponents
(
void
)
{
static
QVariantList
emptyList
;
return
emptyList
;
}
const
QVariantMap
&
GenericAutoPilotPlugin
::
parameters
(
void
)
{
return
_parameterFacts
->
factMap
();
}
QUrl
GenericAutoPilotPlugin
::
setupBackgroundImage
(
void
)
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/px4fmu_2.x.png"
);
}
void
GenericAutoPilotPlugin
::
_factsReady
(
void
)
void
GenericAutoPilotPlugin
::
_parametersReady
(
void
)
{
_pluginReady
=
true
;
emit
pluginReadyChanged
(
_pluginReady
);
...
...
src/AutoPilotPlugins/Generic/GenericAutoPilotPlugin.h
View file @
4b128fba
...
...
@@ -41,16 +41,15 @@ public:
GenericAutoPilotPlugin
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
// Overrides from AutoPilotPlugin
virtual
QUrl
setupBackgroundImage
(
void
);
virtual
const
QVariantList
&
components
(
void
);
virtual
const
QVariantMap
&
parameters
(
void
);
virtual
const
QVariantList
&
vehicleComponents
(
void
);
virtual
ParameterLoader
*
getParameterLoader
(
void
)
{
return
_parameterFacts
;
}
static
QList
<
AutoPilotPluginManager
::
FullMode_t
>
getModes
(
void
);
static
QString
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
);
static
void
clearStaticData
(
void
);
private
slots
:
void
_
fact
sReady
(
void
);
void
_
parameter
sReady
(
void
);
private:
GenericParameterFacts
*
_parameterFacts
;
...
...
src/AutoPilotPlugins/Generic/GenericParameterFacts.cc
View file @
4b128fba
...
...
@@ -25,13 +25,11 @@
/// @author Don Gagne <don@thegagnes.com>
#include "GenericParameterFacts.h"
#include "QGCApplication.h"
#include <QFile>
#include <QDebug>
GenericParameterFacts
::
GenericParameterFacts
(
UASInterface
*
uas
,
QObject
*
parent
)
:
Fact
Loader
(
uas
,
parent
)
Parameter
Loader
(
uas
,
parent
)
{
Q_ASSERT
(
uas
);
}
src/AutoPilotPlugins/Generic/GenericParameterFacts.h
View file @
4b128fba
...
...
@@ -25,11 +25,8 @@
#define GenericParameterFacts_h
#include <QObject>
#include <QMap>
#include <QXmlStreamReader>
#include <QLoggingCategory>
#include "
FactSystem
.h"
#include "
ParameterLoader
.h"
#include "UASInterface.h"
/// @file
...
...
@@ -37,13 +34,16 @@
/// Collection of Parameter Facts for Generic AutoPilot
class
GenericParameterFacts
:
public
Fact
Loader
class
GenericParameterFacts
:
public
Parameter
Loader
{
Q_OBJECT
public:
/// @param uas Uas which this set of facts is associated with
GenericParameterFacts
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
/// Override from ParameterLoader
virtual
QString
getDefaultComponentIdParam
(
void
)
const
{
return
QString
();
}
};
#endif
\ No newline at end of file
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
4b128fba
...
...
@@ -80,7 +80,7 @@ PX4AutoPilotPlugin::PX4AutoPilotPlugin(UASInterface* uas, QObject* parent) :
_parameterFacts
=
new
PX4ParameterFacts
(
uas
,
this
);
Q_CHECK_PTR
(
_parameterFacts
);
connect
(
_parameterFacts
,
&
PX4ParameterFacts
::
fact
sReady
,
this
,
&
PX4AutoPilotPlugin
::
_pluginReadyPreChecks
);
connect
(
_parameterFacts
,
&
PX4ParameterFacts
::
parameter
sReady
,
this
,
&
PX4AutoPilotPlugin
::
_pluginReadyPreChecks
);
PX4ParameterFacts
::
loadParameterFactMetaData
();
}
...
...
@@ -189,7 +189,7 @@ void PX4AutoPilotPlugin::clearStaticData(void)
PX4ParameterFacts
::
clearStaticData
();
}
const
QVariantList
&
PX4AutoPilotPlugin
::
c
omponents
(
void
)
const
QVariantList
&
PX4AutoPilotPlugin
::
vehicleC
omponents
(
void
)
{
if
(
_components
.
count
()
==
0
&&
!
_incorrectParameterVersion
)
{
Q_ASSERT
(
_uas
);
...
...
@@ -222,29 +222,19 @@ const QVariantList& PX4AutoPilotPlugin::components(void)
return
_components
;
}
const
QVariantMap
&
PX4AutoPilotPlugin
::
parameters
(
void
)
{
return
_parameterFacts
->
factMap
();
}
QUrl
PX4AutoPilotPlugin
::
setupBackgroundImage
(
void
)
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/px4fmu_2.x.png"
);
}
/// This will perform various checks prior to signalling that the plug in ready
void
PX4AutoPilotPlugin
::
_pluginReadyPreChecks
(
void
)
{
// Check for older parameter version set
// FIXME: Firmware is moving to version stamp parameter set. Once that is complete the version stamp
// should be used instead.
if
(
parameter
s
().
contain
s
(
"SENS_GYRO_XOFF"
))
{
if
(
parameter
Exist
s
(
"SENS_GYRO_XOFF"
))
{
_incorrectParameterVersion
=
true
;
QGCMessageBox
::
warning
(
tr
(
"Setup"
),
tr
(
"This version of GroundControl can only perform vehicle setup on a newer version of firmware. "
"Please perform a Firmware Upgrade if you wish to use Vehicle Setup."
));
}
else
{
// Check for missing setup complete
foreach
(
const
QVariant
componentVariant
,
c
omponents
())
{
foreach
(
const
QVariant
componentVariant
,
vehicleC
omponents
())
{
VehicleComponent
*
component
=
qobject_cast
<
VehicleComponent
*>
(
qvariant_cast
<
QObject
*>
(
componentVariant
));
Q_ASSERT
(
component
);
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.h
View file @
4b128fba
...
...
@@ -50,9 +50,8 @@ public:
~
PX4AutoPilotPlugin
();
// Overrides from AutoPilotPlugin
virtual
const
QVariantList
&
components
(
void
);
virtual
const
QVariantMap
&
parameters
(
void
);
virtual
QUrl
setupBackgroundImage
(
void
);
virtual
const
QVariantList
&
vehicleComponents
(
void
);
virtual
ParameterLoader
*
getParameterLoader
(
void
)
{
return
_parameterFacts
;
}
static
QList
<
AutoPilotPluginManager
::
FullMode_t
>
getModes
(
void
);
static
QString
getShortModeText
(
uint8_t
baseMode
,
uint32_t
customMode
);
...
...
src/AutoPilotPlugins/PX4/PX4ParameterFacts.cc
View file @
4b128fba
...
...
@@ -37,7 +37,7 @@ bool PX4ParameterFacts::_parameterMetaDataLoaded = false;
QMap
<
QString
,
FactMetaData
*>
PX4ParameterFacts
::
_mapParameterName2FactMetaData
;
PX4ParameterFacts
::
PX4ParameterFacts
(
UASInterface
*
uas
,
QObject
*
parent
)
:
Fact
Loader
(
uas
,
parent
)
Parameter
Loader
(
uas
,
parent
)
{
Q_ASSERT
(
uas
);
}
...
...
@@ -273,6 +273,6 @@ void PX4ParameterFacts::_addMetaDataToFact(Fact* fact)
fact
->
setMetaData
(
_mapParameterName2FactMetaData
[
fact
->
name
()]);
}
else
{
// Use generic meta data
Fact
Loader
::
_addMetaDataToFact
(
fact
);
Parameter
Loader
::
_addMetaDataToFact
(
fact
);
}
}
src/AutoPilotPlugins/PX4/PX4ParameterFacts.h
View file @
4b128fba
...
...
@@ -21,14 +21,15 @@
======================================================================*/
#ifndef PX4P
arameterFacts_h
#define PX4P
arameterFacts_h
#ifndef PX4P
ARAMETERFACTS_H
#define PX4P
ARAMETERFACTS_H
#include <QObject>
#include <QMap>
#include <QXmlStreamReader>
#include <QLoggingCategory>
#include "ParameterLoader.h"
#include "FactSystem.h"
#include "UASInterface.h"
...
...
@@ -39,7 +40,7 @@ Q_DECLARE_LOGGING_CATEGORY(PX4ParameterFactsMetaDataLog)
/// Collection of Parameter Facts for PX4 AutoPilot
class
PX4ParameterFacts
:
public
Fact
Loader
class
PX4ParameterFacts
:
public
Parameter
Loader
{
Q_OBJECT
...
...
@@ -47,6 +48,9 @@ public:
/// @param uas Uas which this set of facts is associated with
PX4ParameterFacts
(
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
/// Override from ParameterLoader
virtual
QString
getDefaultComponentIdParam
(
void
)
const
{
return
QString
(
"SYS_AUTOSTART"
);
}
static
void
loadParameterFactMetaData
(
void
);
static
void
deleteParameterFactMetaData
(
void
);
static
void
clearStaticData
(
void
);
...
...
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