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
23b1190f
Unverified
Commit
23b1190f
authored
Dec 24, 2018
by
Don Gagne
Committed by
GitHub
Dec 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7099 from DonLakeFlyer/Rover
Rover isFlying check fix
parents
87e63a9b
16d355df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
12 deletions
+33
-12
SetupPage.qml
src/AutoPilotPlugins/Common/SetupPage.qml
+1
-1
QGCApplication.cc
src/QGCApplication.cc
+25
-0
QGCApplication.h
src/QGCApplication.h
+3
-0
FirmwareImage.cc
src/VehicleSetup/FirmwareImage.cc
+4
-11
No files found.
src/AutoPilotPlugins/Common/SetupPage.qml
View file @
23b1190f
...
...
@@ -40,7 +40,7 @@ QGCView {
property
bool
_vehicleFlying
:
_activeVehicle
?
_activeVehicle
.
flying
:
false
property
bool
_disableDueToArmed
:
vehicleComponent
?
(
!
vehicleComponent
.
allowSetupWhileArmed
&&
_vehicleArmed
)
:
false
// FIXME: The _vehicleIsRover checkl is a hack to work around https://github.com/PX4/Firmware/issues/10969
property
bool
_disableDueToFlying
:
vehicleComponent
?
(
_vehicleIsRover
||
(
!
vehicleComponent
.
allowSetupWhileFlying
&&
_vehicleFlying
)
)
:
false
property
bool
_disableDueToFlying
:
vehicleComponent
?
(
!
_vehicleIsRover
&&
!
vehicleComponent
.
allowSetupWhileFlying
&&
_vehicleFlying
)
:
false
property
string
_disableReason
:
_disableDueToArmed
?
qsTr
(
"
armed
"
)
:
qsTr
(
"
flying
"
)
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
...
...
src/QGCApplication.cc
View file @
23b1190f
...
...
@@ -89,6 +89,7 @@
#include "FactValueSliderListModel.h"
#include "ShapeFileHelper.h"
#include "QGCFileDownload.h"
#include "FirmwareImage.h"
#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
...
...
@@ -236,11 +237,13 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
// Parse command line options
bool
fClearSettingsOptions
=
false
;
// Clear stored settings
bool
fClearCache
=
false
;
// Clear parameter/airframe caches
bool
logging
=
false
;
// Turn on logging
QString
loggingOptions
;
CmdLineOpt_t
rgCmdLineOptions
[]
=
{
{
"--clear-settings"
,
&
fClearSettingsOptions
,
nullptr
},
{
"--clear-cache"
,
&
fClearCache
,
nullptr
},
{
"--logging"
,
&
logging
,
&
loggingOptions
},
{
"--fake-mobile"
,
&
_fakeMobile
,
nullptr
},
{
"--log-output"
,
&
_logOutput
,
nullptr
},
...
...
@@ -309,6 +312,15 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
}
settings
.
setValue
(
_settingsVersionKey
,
QGC_SETTINGS_VERSION
);
if
(
fClearCache
)
{
QDir
dir
(
ParameterManager
::
parameterCacheDir
());
dir
.
removeRecursively
();
QFile
airframe
(
cachedAirframeMetaDataFile
());
airframe
.
remove
();
QFile
parameter
(
cachedParameterMetaDataFile
());
parameter
.
remove
();
}
// Set up our logging filters
QGCLoggingCategoryRegister
::
instance
()
->
setFilterRulesFromSettings
(
loggingOptions
);
...
...
@@ -839,3 +851,16 @@ void QGCApplication::_gpsNumSatellites(int numSatellites)
_gpsRtkFactGroup
->
numSatellites
()
->
setRawValue
(
numSatellites
);
}
QString
QGCApplication
::
cachedParameterMetaDataFile
(
void
)
{
QSettings
settings
;
QDir
parameterDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
return
parameterDir
.
filePath
(
QStringLiteral
(
"ParameterFactMetaData.xml"
));
}
QString
QGCApplication
::
cachedAirframeMetaDataFile
(
void
)
{
QSettings
settings
;
QDir
airframeDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
return
airframeDir
.
filePath
(
QStringLiteral
(
"PX4AirframeFactMetaData.xml"
));
}
src/QGCApplication.h
View file @
23b1190f
...
...
@@ -98,6 +98,9 @@ public:
FactGroup
*
gpsRtkFactGroup
(
void
)
{
return
_gpsRtkFactGroup
;
}
static
QString
cachedParameterMetaDataFile
(
void
);
static
QString
cachedAirframeMetaDataFile
(
void
);
public
slots
:
/// You can connect to this slot to show an information message box from a different thread.
void
informationMessageBoxOnMainThread
(
const
QString
&
title
,
const
QString
&
msg
);
...
...
src/VehicleSetup/FirmwareImage.cc
View file @
23b1190f
...
...
@@ -275,12 +275,8 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
_jsonParamXmlKey
,
// key which holds compressed bytes
decompressedBytes
);
// Returned decompressed bytes
if
(
success
)
{
// Use settings location as our work directory, this way is something goes wrong the file is still there
// sitting next to the cache files.
QSettings
settings
;
QDir
parameterDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
QString
parameterFilename
=
parameterDir
.
filePath
(
"ParameterFactMetaData.xml"
);
QFile
parameterFile
(
parameterFilename
);
QString
parameterFilename
=
QGCApplication
::
cachedParameterMetaDataFile
();
QFile
parameterFile
(
QGCApplication
::
cachedParameterMetaDataFile
());
if
(
parameterFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
qint64
bytesWritten
=
parameterFile
.
write
(
decompressedBytes
);
...
...
@@ -306,12 +302,9 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
_jsonAirframeXmlKey
,
// key which holds compressed bytes
decompressedBytes
);
// Returned decompressed bytes
if
(
success
)
{
// We cache the airframe xml in the same location as settings and parameters
QSettings
settings
;
QDir
airframeDir
=
QFileInfo
(
settings
.
fileName
()).
dir
();
QString
airframeFilename
=
airframeDir
.
filePath
(
"PX4AirframeFactMetaData.xml"
);
QString
airframeFilename
=
QGCApplication
::
cachedAirframeMetaDataFile
();
//qDebug() << airframeFilename;
QFile
airframeFile
(
airframeFilename
);
QFile
airframeFile
(
QGCApplication
::
cachedAirframeMetaDataFile
()
);
if
(
airframeFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
qint64
bytesWritten
=
airframeFile
.
write
(
decompressedBytes
);
...
...
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