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
f606cdda
Commit
f606cdda
authored
Feb 07, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear setting clears cached files
parent
34ee1349
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
11 deletions
+41
-11
PX4AirframeLoader.cc
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc
+9
-4
PX4AirframeLoader.h
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h
+4
-1
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+1
-1
ParameterLoader.cc
src/FactSystem/ParameterLoader.cc
+7
-2
ParameterLoader.h
src/FactSystem/ParameterLoader.h
+3
-0
PX4ParameterMetaData.cc
src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
+8
-3
PX4ParameterMetaData.h
src/FirmwarePlugin/PX4/PX4ParameterMetaData.h
+3
-0
QGCApplication.cc
src/QGCApplication.cc
+6
-0
No files found.
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc
View file @
f606cdda
...
...
@@ -46,10 +46,17 @@ PX4AirframeLoader::PX4AirframeLoader(AutoPilotPlugin* autopilot, UASInterface* u
Q_ASSERT
(
uas
);
}
QString
PX4AirframeLoader
::
aiframeMetaDataFile
(
void
)
{
QSettings
settings
;
QDir
parameterDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
return
parameterDir
.
filePath
(
"PX4AirframeFactMetaData.xml"
);
}
/// Load Airframe Fact meta data
///
/// The meta data comes from firmware airframes.xml file.
void
PX4AirframeLoader
::
loadAirframe
Fact
MetaData
(
void
)
void
PX4AirframeLoader
::
loadAirframeMetaData
(
void
)
{
if
(
_airframeMetaDataLoaded
)
{
return
;
...
...
@@ -64,9 +71,7 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
// We want unit test builds to always use the resource based meta data to provide repeatable results
if
(
!
qgcApp
()
->
runningUnitTests
())
{
// First look for meta data that comes from a firmware download. Fall back to resource if not there.
QSettings
settings
;
QDir
parameterDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
airframeFilename
=
parameterDir
.
filePath
(
"PX4AirframeFactMetaData.xml"
);
airframeFilename
=
aiframeMetaDataFile
();
}
if
(
airframeFilename
.
isEmpty
()
||
!
QFile
(
airframeFilename
).
exists
())
{
airframeFilename
=
":/AutoPilotPlugins/PX4/AirframeFactMetaData.xml"
;
...
...
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h
View file @
f606cdda
...
...
@@ -49,7 +49,10 @@ public:
/// @param uas Uas which this set of facts is associated with
PX4AirframeLoader
(
AutoPilotPlugin
*
autpilot
,
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
static
void
loadAirframeFactMetaData
(
void
);
static
void
loadAirframeMetaData
(
void
);
/// @return Location of PX4 airframe fact meta data file
static
QString
aiframeMetaDataFile
(
void
);
private:
enum
{
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
f606cdda
...
...
@@ -81,7 +81,7 @@ PX4AutoPilotPlugin::PX4AutoPilotPlugin(Vehicle* vehicle, QObject* parent) :
_airframeFacts
=
new
PX4AirframeLoader
(
this
,
_vehicle
->
uas
(),
this
);
Q_CHECK_PTR
(
_airframeFacts
);
PX4AirframeLoader
::
loadAirframe
Fact
MetaData
();
PX4AirframeLoader
::
loadAirframeMetaData
();
}
PX4AutoPilotPlugin
::~
PX4AutoPilotPlugin
()
...
...
src/FactSystem/ParameterLoader.cc
View file @
f606cdda
...
...
@@ -620,13 +620,18 @@ void ParameterLoader::_writeLocalParamCache()
ds
<<
cache_map
;
}
QString
ParameterLoader
::
parameterCacheFile
(
void
)
{
const
QDir
settingsDir
(
QFileInfo
(
QSettings
().
fileName
()).
dir
());
return
settingsDir
.
filePath
(
"param_cache"
);
}
void
ParameterLoader
::
_tryCacheHashLoad
(
int
uasId
,
QVariant
hash_value
)
{
uint32_t
crc32_value
=
0
;
/* The datastructure of the cache table */
QMap
<
int
,
MapID2NamedParam
>
cache_map
;
const
QDir
settingsDir
(
QFileInfo
(
QSettings
().
fileName
()).
dir
());
QFile
cache_file
(
settingsDir
.
filePath
(
"param_cache"
));
QFile
cache_file
(
parameterCacheFile
());
if
(
!
cache_file
.
exists
())
{
/* no local cache, immediately refresh all params */
refreshAllParameters
();
...
...
src/FactSystem/ParameterLoader.h
View file @
f606cdda
...
...
@@ -52,6 +52,9 @@ public:
ParameterLoader
(
AutoPilotPlugin
*
autopilot
,
Vehicle
*
vehicle
,
QObject
*
parent
=
NULL
);
~
ParameterLoader
();
/// @return Location of parameter cache file
static
QString
parameterCacheFile
(
void
);
/// Returns true if the full set of facts are ready
bool
parametersAreReady
(
void
)
{
return
_parametersReady
;
}
...
...
src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
View file @
f606cdda
...
...
@@ -78,6 +78,13 @@ QVariant PX4ParameterMetaData::_stringToTypedVariant(const QString& string, Fact
return
var
;
}
QString
PX4ParameterMetaData
::
parameterMetaDataFile
(
void
)
{
QSettings
settings
;
QDir
parameterDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
return
parameterDir
.
filePath
(
"PX4ParameterFactMetaData.xml"
);
}
/// Load Parameter Fact meta data
///
/// The meta data comes from firmware parameters.xml file.
...
...
@@ -97,9 +104,7 @@ void PX4ParameterMetaData::_loadParameterFactMetaData(void)
// We want unit test builds to always use the resource based meta data to provide repeatable results
if
(
!
qgcApp
()
->
runningUnitTests
())
{
// First look for meta data that comes from a firmware download. Fall back to resource if not there.
QSettings
settings
;
QDir
parameterDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
parameterFilename
=
parameterDir
.
filePath
(
"PX4ParameterFactMetaData.xml"
);
parameterFilename
=
parameterMetaDataFile
();
}
if
(
parameterFilename
.
isEmpty
()
||
!
QFile
(
parameterFilename
).
exists
())
{
parameterFilename
=
":/AutoPilotPlugins/PX4/ParameterFactMetaData.xml"
;
...
...
src/FirmwarePlugin/PX4/PX4ParameterMetaData.h
View file @
f606cdda
...
...
@@ -49,6 +49,9 @@ public:
void
addMetaDataToFact
(
Fact
*
fact
,
MAV_TYPE
vehicleType
);
/// @return Location of PX4 parameter meta data file
static
QString
parameterMetaDataFile
(
void
);
private:
enum
{
XmlStateNone
,
...
...
src/QGCApplication.cc
View file @
f606cdda
...
...
@@ -97,6 +97,7 @@
#include "VideoSurface.h"
#include "VideoReceiver.h"
#include "LogDownloadController.h"
#include "PX4AirframeLoader.h"
#ifndef __ios__
#include "SerialLink.h"
...
...
@@ -365,8 +366,13 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
if
(
fClearSettingsOptions
)
{
// User requested settings to be cleared on command line
settings
.
clear
();
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
QFile
::
remove
(
PX4AirframeLoader
::
aiframeMetaDataFile
());
QFile
::
remove
(
PX4ParameterMetaData
::
parameterMetaDataFile
());
QFile
::
remove
(
ParameterLoader
::
parameterCacheFile
());
}
_defaultMapPosition
.
setLatitude
(
settings
.
value
(
_defaultMapPositionLatKey
,
37.803784
).
toDouble
());
...
...
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