Commit 313a7b90 authored by Valentin Platzgummer's avatar Valentin Platzgummer

12312

parent 4666c881
......@@ -781,6 +781,15 @@ bool MissionController::_loadJsonMissionFileV2(const QJsonObject& json, QmlObjec
nextSequenceNumber = corridorItem->lastSequenceNumber() + 1;
qCDebug(MissionControllerLog) << "Corridor Scan load complete: nextSequenceNumber" << nextSequenceNumber;
visualItems->append(corridorItem);
} else if (complexItemType == CircularSurveyComplexItem::jsonComplexItemTypeValue) {
qCDebug(MissionControllerLog) << "Loading Circular Survey: nextSequenceNumber" << nextSequenceNumber;
CircularSurveyComplexItem* circularSurvey = new CircularSurveyComplexItem(_controllerVehicle, _flyView, QString() /* kmlFile */, visualItems);
if (!circularSurvey->load(itemObject, nextSequenceNumber++, errorString)) {
return false;
}
nextSequenceNumber = circularSurvey->lastSequenceNumber() + 1;
qCDebug(MissionControllerLog) << "Circular Survey load complete: nextSequenceNumber" << nextSequenceNumber;
visualItems->append(circularSurvey);
} else if (complexItemType == MissionSettingsItem::jsonComplexItemTypeValue) {
qCDebug(MissionControllerLog) << "Loading Mission Settings: nextSequenceNumber" << nextSequenceNumber;
MissionSettingsItem* settingsItem = new MissionSettingsItem(_controllerVehicle, _flyView, visualItems);
......
......@@ -72,6 +72,13 @@ Rectangle {
visible: transectsHeader.checked
QGCLabel { text: qsTr("Altitude") }
FactTextField {
fact: missionItem.cameraCalc.distanceToSurface
Layout.fillWidth: true
//onUpdated: rSlider.value = missionItem.deltaR.value
}
QGCLabel { text: qsTr("Delta R") }
FactTextField {
fact: missionItem.deltaR
......
This diff is collapsed.
......@@ -56,6 +56,13 @@ public:
static const char* deltaRName;
static const char* deltaAlphaName;
static const char* jsonComplexItemTypeValue;
static const char* jsonDeltaRKey;
static const char* jsonDeltaAlphaKey;
static const char* jsonReferencePointLongKey;
static const char* jsonReferencePointLatKey;
static const char* jsonReferencePointAltKey;
signals:
void refPointChanged();
void autoGeneratedChanged();
......@@ -70,6 +77,11 @@ private slots:
signals:
private:
void _appendLoadedMissionItems(QList<MissionItem*>& items, QObject* missionItemParent);
void _buildAndAppendMissionItems(QList<MissionItem*>& items, QObject* missionItemParent);
QGeoCoordinate _referencePoint; // center of the circular lanes, e.g. base station
QMap<QString, FactMetaData*> _metaDataMap;
......
......@@ -497,9 +497,17 @@ bool WimaPlaner::loadFromFile(const QString &filename)
emit currentFileChanged();
//recalcJoinedArea();
// MissionItems4
// MissionItems
// extrac MissionItems part
QJsonDocument missionJsonDoc = QJsonDocument(json[missionItemsName].toObject());
// bool ret = json.contains(missionItemsName);
// qWarning() << ret;
QJsonObject missionObject = json[missionItemsName].toObject();
//qWarning() << json[missionItemsName].type();
QJsonDocument missionJsonDoc = QJsonDocument(missionObject);
// create temporary file with missionItems
QFile temporaryFile;
QString cropedFileName = filename.section("/",0,-2);
......@@ -508,7 +516,8 @@ bool WimaPlaner::loadFromFile(const QString &filename)
#endif
QString temporaryFileName;
for (int i = 0; ; i++) {
temporaryFileName = cropedFileName.append("/temp%1.%2").arg(i).arg(AppSettings::planFileExtension);
temporaryFileName = cropedFileName + QString("/temp%1.%2").arg(i).arg(AppSettings::planFileExtension);
// qWarning() << temporaryFileName;
if ( !QFile::exists(temporaryFileName) ) {
temporaryFile.setFileName(temporaryFileName);
......@@ -523,7 +532,9 @@ bool WimaPlaner::loadFromFile(const QString &filename)
}
}
// qWarning() << missionJsonDoc.toVariant().toString();
temporaryFile.write(missionJsonDoc.toJson());
temporaryFile.close();
// load from temporary file
_masterController->loadFromFile(temporaryFileName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment