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
a7c5a57a
Unverified
Commit
a7c5a57a
authored
Feb 29, 2020
by
Don Gagne
Committed by
GitHub
Feb 29, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8445 from dakejahl/pr-survey_preset_default_support
Compiler switch for Survey Preset JSON generation
parents
988cd6a9
6b50da59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
ComplexMissionItem.cc
src/MissionManager/ComplexMissionItem.cc
+22
-0
ComplexMissionItem.h
src/MissionManager/ComplexMissionItem.h
+7
-0
No files found.
src/MissionManager/ComplexMissionItem.cc
View file @
a7c5a57a
...
...
@@ -20,6 +20,8 @@ const char* ComplexMissionItem::_presetSettingsKey = "_presets";
ComplexMissionItem
::
ComplexMissionItem
(
Vehicle
*
vehicle
,
bool
flyView
,
QObject
*
parent
)
:
VisualMissionItem
(
vehicle
,
flyView
,
parent
)
,
_toolbox
(
qgcApp
()
->
toolbox
())
,
_settingsManager
(
_toolbox
->
settingsManager
())
{
}
...
...
@@ -74,6 +76,26 @@ void ComplexMissionItem::_savePresetJson(const QString& name, QJsonObject& prese
settings
.
beginGroup
(
presetsSettingsGroup
());
settings
.
beginGroup
(
_presetSettingsKey
);
settings
.
setValue
(
name
,
QJsonDocument
(
presetObject
).
toBinaryData
());
// Use this to save a survey preset as a JSON file to be included in the build
// as a built-in survey preset that cannot be deleted.
#if 0
QString savePath = _settingsManager->appSettings()->missionSavePath();
QDir saveDir(savePath);
QString fileName = saveDir.absoluteFilePath(name);
fileName.append(".json");
QFile jsonFile(fileName);
if (!jsonFile.open(QIODevice::WriteOnly)) {
qDebug() << "Couldn't open .json file.";
}
qDebug() << "Saving survey preset to JSON";
auto jsonDoc = QJsonDocument(jsonObj);
jsonFile.write(jsonDoc.toJson());
#endif
emit
presetNamesChanged
();
}
...
...
src/MissionManager/ComplexMissionItem.h
View file @
a7c5a57a
...
...
@@ -15,6 +15,10 @@
#include <QSettings>
#include <QGCToolbox.h>
#include <SettingsManager.h>
class
ComplexMissionItem
:
public
VisualMissionItem
{
Q_OBJECT
...
...
@@ -87,6 +91,9 @@ protected:
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
static
const
char
*
_presetSettingsKey
;
QGCToolbox
*
_toolbox
;
SettingsManager
*
_settingsManager
;
};
#endif
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