Commit 05c2790f authored by Valentin Platzgummer's avatar Valentin Platzgummer

adding

parent d29b8b03
...@@ -408,16 +408,19 @@ HEADERS += \ ...@@ -408,16 +408,19 @@ HEADERS += \
src/comm/MavlinkMessagesTimer.h \ src/comm/MavlinkMessagesTimer.h \
src/GPS/Drivers/src/base_station.h \ src/GPS/Drivers/src/base_station.h \
src/Wima/WimaArea.h \ src/Wima/WimaArea.h \
src/Wima/WimaGOperationArea.h \
src/Wima/WimaServiceArea.h \ src/Wima/WimaServiceArea.h \
src/Wima/WimaVCorridor.h \
src/Wima/WimaTrackerPolyline.h \ src/Wima/WimaTrackerPolyline.h \
src/Wima/WimaController.h \ src/Wima/WimaController.h \
src/Wima/WimaVehicle.h \ src/Wima/WimaVehicle.h \
src/Wima/WimaDataContainer.h \ src/Wima/WimaDataContainer.h \
src/Wima/WimaPlaner.h \ src/Wima/WimaPlaner.h \
src/Wima/WimaPlaner.h \ src/Wima/WimaPlaner.h \
src/Wima/WimaMeasurementArea.h src/Wima/WimaMeasurementArea.h \
src/Wima/WimaCorridor.h \
src/Wima/WimaAreaData.h \
src/Wima/WimaServiceAreaData.h \
src/Wima/WimaCorridorData.h \
src/Wima/WimaMeasurementAreaData.h
SOURCES += \ SOURCES += \
src/api/QGCCorePlugin.cc \ src/api/QGCCorePlugin.cc \
src/api/QGCOptions.cc \ src/api/QGCOptions.cc \
...@@ -426,13 +429,17 @@ SOURCES += \ ...@@ -426,13 +429,17 @@ SOURCES += \
src/comm/MavlinkMessagesTimer.cc \ src/comm/MavlinkMessagesTimer.cc \
src/Wima/WimaArea.cc \ src/Wima/WimaArea.cc \
src/Wima/WimaServiceArea.cc \ src/Wima/WimaServiceArea.cc \
src/Wima/WimaVCorridor.cc \
src/Wima/WimaTrackerPolyline.cc \ src/Wima/WimaTrackerPolyline.cc \
src/Wima/WimaController.cc \ src/Wima/WimaController.cc \
src/Wima/WimaVehicle.cc \ src/Wima/WimaVehicle.cc \
src/Wima/WimaDataContainer.cc \ src/Wima/WimaDataContainer.cc \
src/Wima/WimaPlaner.cc \ src/Wima/WimaPlaner.cc \
src/Wima/WimaMeasurementArea.cc src/Wima/WimaMeasurementArea.cc \
src/Wima/WimaCorridor.cc \
src/Wima/WimaAreaData.cc \
src/Wima/WimaServiceAreaData.cc \
src/Wima/WimaCorridorData.cpp \
src/Wima/WimaMeasurementAreaDataareadata.cc
# #
# Unit Test specific configuration goes here (requires full debug build with all plugins) # Unit Test specific configuration goes here (requires full debug build with all plugins)
......
...@@ -677,7 +677,7 @@ bool WimaArea::loadFromJson(const QJsonObject &json, QString& errorString) ...@@ -677,7 +677,7 @@ bool WimaArea::loadFromJson(const QJsonObject &json, QString& errorString)
void WimaArea::update(const WimaArea &area) void WimaArea::update(const WimaArea &area)
{ {
this->QGCMapPolygon::update(area); this->QGCMapPolygon::update(area);
this->setMaxAltitude(area.maxAltitude());displays this->setMaxAltitude(area.maxAltitude());
} }
/*! /*!
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
static bool dijkstraPath (const QGeoCoordinate& c1, const QGeoCoordinate& c2, static bool dijkstraPath (const QGeoCoordinate& c1, const QGeoCoordinate& c2,
const WimaArea& area, QList<QGeoCoordinate>& dijkstraPath); const WimaArea& area, QList<QGeoCoordinate>& dijkstraPath);
/// @return true if the polygon is self intersecting /// @return true if the polygon is self intersecting
static bool isSelfIntersecting (const WimaArea& area); static bool isSelfIntersectin contrast to \c WimaAreaing (const WimaArea& area);
bool isSelfIntersecting (); bool isSelfIntersecting ();
// Friends // Friends
......
#include "WimaAreaData.h"
WimaAreaData::WimaAreaData(QObject *parent) : QObject(parent)
{
_maxAltitude = 0;
}
WimaAreaData::WimaAreaData(WimaAreaData &other, QObject *parent)
: QObject (parent)
, _maxAltitude(other.maxAltitude())
{
setPath(other.path());
}
/*!
* \fn double WimaAreaData::maxAltitude()
*
* Returns the maximum altitude at which vehicles are allowed to fly.
*/
double WimaAreaData::maxAltitude() const
{
return _maxAltitude;
}
/*!
* \fn double WimaAreaData::maxAltitude()
*
* Returns the path (vertex list defining the \l {Simple Polygon}).
*/
const QList<QGeoCoordinate> &WimaAreaData::path() const
{
return _path;
}
/*!
* \fn void WimaAreaData::setMaxAltitude(double maxAltitude)
*
* Sets the maximum altitude member to \a maxAltitude and emits the \c maxAltitudeChanged() signal if
* \a maxAltitude differs from the members value.
*/
void WimaAreaData::setMaxAltitude(double maxAltitude)
{
if ( !qFuzzyCompare(_maxAltitude, maxAltitude) ) {
_maxAltitude = maxAltitude;
emit maxAltitudeChanged(_maxAltitude);
}
}
/*!
* \fn void WimaAreaData::setPath(const QList<QGeoCoordinate> &coordinateList)
*
* Sets the path member to \a coordinateList by copying all entries of \a coordinateList.
* Emits the \c pathChanged() signal.
*/
void WimaAreaData::setPath(const QList<QGeoCoordinate> &coordinateList)
{
_path.clear();
// copy all coordinates to _path
for(int i = 0; i < coordinateList.size(); i++) {
_path.append(coordinateList.value(i));
}
emit pathChanged(_path);
}
/*!
* \class WimaArea::WimaAreaData
* \brief Class to store and exchange data of a \c WimaArea Object.
* Class to store and exchange data of a \c WimaArea Object. In contrast to \c WimaArea this class
* does not provied any interface to a grafical user interface, neiter it uses the QGC Fact System.
* It is designed to exchange data between the \c WimaPlaner and the \c WimaController class. And it
* is the base class for any derived data objects
*
* \sa WimaArea
*/
#pragma once
#include <QObject>
#include "QGeoCoordinate"
class WimaAreaData : public QObject
{
Q_OBJECT
public:
explicit WimaAreaData(QObject *parent = nullptr);
explicit WimaAreaData(WimaAreaData &other, QObject *parent = nullptr);
double maxAltitude() const;
const QList<QGeoCoordinate>& path() const;
signals:
void maxAltitudeChanged(double maxAltitude);
void pathChanged(const QList<QGeoCoordinate>& coordinateList);
public slots:
void setMaxAltitude(double maxAltitude);
void setPath(const QList<QGeoCoordinate>& coordinateList);
private:
// see WimaArea.h for explanation
double _maxAltitude;
QList<QGeoCoordinate> _path;
};
#include "WimaController.h" #include "WimaController.h"
const char* WimaController::wimaFileExtension = "wima"; const char* WimaController::wimaFileExtension = "wima";
const char* WimaController::areaItemsName = "AreaItems"; const char* WimaController::areaItemsName = "AreaItems";
...@@ -43,11 +43,6 @@ QGeoCoordinate WimaController::joinedAreaCenter() const ...@@ -43,11 +43,6 @@ QGeoCoordinate WimaController::joinedAreaCenter() const
return _joinedArea.center(); return _joinedArea.center();
} }
QGCMapPolygon WimaController::joinedArea() const
{
return _joinedArea;
}
void WimaController::setMasterController(PlanMasterController *masterC) void WimaController::setMasterController(PlanMasterController *masterC)
{ {
_masterController = masterC; _masterController = masterC;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "WimaArea.h" #include "WimaArea.h"
#include "WimaMeasurementArea.h" #include "WimaMeasurementArea.h"
#include "WimaServiceArea.h" #include "WimaServiceArea.h"
#include "WimaVCorridor.h" #include "WimaCorridor.h"
#include "WimaDataContainer.h" #include "WimaDataContainer.h"
#include "PlanMasterController.h" #include "PlanMasterController.h"
...@@ -37,8 +37,8 @@ public: ...@@ -37,8 +37,8 @@ public:
Q_PROPERTY(QStringList saveNameFilters READ saveNameFilters CONSTANT) Q_PROPERTY(QStringList saveNameFilters READ saveNameFilters CONSTANT)
Q_PROPERTY(QString fileExtension READ fileExtension CONSTANT) Q_PROPERTY(QString fileExtension READ fileExtension CONSTANT)
Q_PROPERTY(QGeoCoordinate joinedAreaCenter READ joinedAreaCenter CONSTANT) Q_PROPERTY(QGeoCoordinate joinedAreaCenter READ joinedAreaCenter CONSTANT)
Q_PROPERTY(WimaArea joinedArea READ joinedArea NOTIFY joinedAreaChanged) Q_PROPERTY(QGCMapPolygon joinedArea READ joinedArea NOTIFY joinedAreaChanged)
Q_PROPERTY(WimaDataContainer* dataContainer WRITE setDataContainer NOTIFY dataContainerChanged) Q_PROPERTY(WimaDataContainer* dataContainer READ dataContainer WRITE setDataContainer NOTIFY dataContainerChanged)
Q_PROPERTY(bool readyForSaveSend READ readyForSaveSend NOTIFY readyForSaveSendChanged) Q_PROPERTY(bool readyForSaveSend READ readyForSaveSend NOTIFY readyForSaveSendChanged)
...@@ -51,7 +51,8 @@ public: ...@@ -51,7 +51,8 @@ public:
QStringList saveNameFilters (void) const; QStringList saveNameFilters (void) const;
QString fileExtension (void) const { return wimaFileExtension; } QString fileExtension (void) const { return wimaFileExtension; }
QGeoCoordinate joinedAreaCenter (void) const; QGeoCoordinate joinedAreaCenter (void) const;
QGCMapPolygon joinedArea(void) const; QGCMapPolygon joinedArea (void) const;
WimaDataContainer* dataContainer (void) const;
bool readyForSaveSend (void) const { return _readyForSaveSend; } bool readyForSaveSend (void) const { return _readyForSaveSend; }
...@@ -92,6 +93,7 @@ signals: ...@@ -92,6 +93,7 @@ signals:
void currentFileChanged (); void currentFileChanged ();
void dataContainerChanged (); void dataContainerChanged ();
void readyForSaveSendChanged (bool ready); void readyForSaveSendChanged (bool ready);
void joinedAreaChanged ();
private slots: private slots:
void pullFromContainer (); void pullFromContainer ();
......
#include "WimaVCorridor.h" #include "WimaCorridor.h"
const char* WimaVCorridor::wimaVCorridorName = "Corridor"; const char* WimaCorridor::WimaCorridorName = "Corridor";
WimaVCorridor::WimaVCorridor(QObject *parent) WimaCorridor::WimaCorridor(QObject *parent)
: WimaArea (parent) : WimaArea (parent)
{ {
init(); init();
} }
WimaVCorridor::WimaVCorridor(const WimaVCorridor &other, QObject *parent) WimaCorridor::WimaCorridor(const WimaCorridor &other, QObject *parent)
: WimaArea (other, parent) : WimaArea (other, parent)
{ {
init(); init();
} }
void WimaVCorridor::saveToJson(QJsonObject &json) void WimaCorridor::saveToJson(QJsonObject &json)
{ {
this->WimaArea::saveToJson(json); this->WimaArea::saveToJson(json);
json[areaTypeName] = wimaVCorridorName; json[areaTypeName] = WimaCorridorName;
} }
bool WimaVCorridor::loadFromJson(const QJsonObject &json, QString &errorString) bool WimaCorridor::loadFromJson(const QJsonObject &json, QString &errorString)
{ {
if ( this->WimaArea::loadFromJson(json, errorString)) { if ( this->WimaArea::loadFromJson(json, errorString)) {
bool retVal = true; bool retVal = true;
...@@ -34,24 +34,30 @@ bool WimaVCorridor::loadFromJson(const QJsonObject &json, QString &errorString) ...@@ -34,24 +34,30 @@ bool WimaVCorridor::loadFromJson(const QJsonObject &json, QString &errorString)
} }
} }
void WimaVCorridor::update(const WimaVCorridor &area) void WimaCorridor::update(const WimaCorridor &area)
{ {
this->WimaArea::update(area); this->WimaArea::update(area);
} }
void WimaVCorridor::init() void WimaCorridor::init()
{ {
this->setObjectName(wimaVCorridorName); this->setObjectName(WimaCorridorName);
} }
void print(const WimaVCorridor &area) void print(const WimaCorridor &area)
{ {
QString message; QString message;
print(area, message); print(area, message);
qWarning() << message; qWarning() << message;
} }
void print(const WimaVCorridor &area, QString &outputString) void print(const WimaCorridor &area, QString &outputString)
{ {
print(static_cast<const WimaArea&>(area), outputString); print(static_cast<const WimaArea&>(area), outputString);
} }
/*!
\class WimaCorridor
\brief Corridor (derived from \c WimaArea) connecting the \c WimaMeasurementArea and the \c WimaServiceArea.
*/
...@@ -3,37 +3,35 @@ ...@@ -3,37 +3,35 @@
#include <QObject> #include <QObject>
#include "WimaArea.h" #include "WimaArea.h"
#include "WimaServiceArea.h" #include "WimaServiceArea.h"
#include "WimaGOperationArea.h" #include "WimaMeasurementArea.h"
class WimaVCorridor : public WimaArea class WimaCorridor : public WimaArea
{ {
Q_OBJECT Q_OBJECT
public: public:
WimaVCorridor(QObject* parent = nullptr); WimaCorridor(QObject* parent = nullptr);
WimaVCorridor(const WimaVCorridor& other, QObject* parent = nullptr); WimaCorridor(const WimaCorridor& other, QObject* parent = nullptr);
// Overrides from WimaPolygon // Overrides from WimaPolygon
QString mapVisualQML (void) const { return "WimaVCorridorMapVisual.qml";} QString mapVisualQML (void) const { return "WimaCorridorMapVisual.qml";}
QString editorQML (void) const { return "WimaVCorridorEditor.qml";} QString editorQML (void) const { return "WimaCorridorEditor.qml";}
// Methodes // Methodes
void saveToJson (QJsonObject& json); void saveToJson (QJsonObject& json);
bool loadFromJson (const QJsonObject& json, QString& errorString); bool loadFromJson (const QJsonObject& json, QString& errorString);
// static Members // static Members
static const char* wimaVCorridorName; static const char* WimaCorridorName;
// Friends // Friends
friend void print(const WimaVCorridor& area, QString& outputString); friend void print(const WimaCorridor& area, QString& outputString);
friend void print(const WimaVCorridor& area); friend void print(const WimaCorridor& area);
signals: signals:
void serviceAreaChanged (WimaServiceArea* serviceArea);
void opAreaChanged (WimaGOperationArea* opArea);
public slots: public slots:
/// Updates this with data from area /// Updates this with data from area
void update(const WimaVCorridor& area); void update(const WimaCorridor& area);
private: private:
void init(); void init();
......
#include "WimaCorridorData.h"
WimaCorridorData::WimaCorridorData(QObject *parent)
:WimaAreaData (parent)
{
}
WimaCorridorData::WimaCorridorData(WimaCorridorData &other, QObject *parent)
: WimaAreaData (other, parent)
{
}
/*!
* \class WimaAreaData::WimaCorridorData
* \brief Class to store and exchange data of a \c WimaCorridorData Object.
* Class to store and exchange data of a \c WimaCorridor Object. In contrast to \c WimaCorridor this class
* does not provied any interface to a grafical user interface, neiter it uses the QGC Fact System.
* It is designed to exchange data between the \c WimaPlaner and the \c WimaController class. And it
* is the derived from WimaAreaData.
*
* \sa WimaCorridor, WimaAreaData
*/
#pragma once
#include <QObject>
#include "WimaAreaData.h"
#include "QGeoCoordinate"
class WimaCorridorData : public WimaAreaData
{
Q_OBJECT
public:
explicit WimaCorridorData(QObject *parent = nullptr);
explicit WimaCorridorData(WimaCorridorData &other, QObject *parent = nullptr);
signals:
public slots:
private:
};
...@@ -19,7 +19,7 @@ void WimaDataContainer::setJoinedArea(const WimaArea *joinedArea) ...@@ -19,7 +19,7 @@ void WimaDataContainer::setJoinedArea(const WimaArea *joinedArea)
} }
} }
void WimaDataContainer::setOpArea(const WimaGOperationArea *opArea) void WimaDataContainer::setOpArea(const WimaMeasurementArea *opArea)
{ {
if (_opArea != opArea) { if (_opArea != opArea) {
_opArea = opArea; _opArea = opArea;
...@@ -37,7 +37,7 @@ void WimaDataContainer::setSerArea(const WimaServiceArea *serArea) ...@@ -37,7 +37,7 @@ void WimaDataContainer::setSerArea(const WimaServiceArea *serArea)
} }
} }
void WimaDataContainer::setCorridor(const WimaVCorridor *corridor) void WimaDataContainer::setCorridor(const WimaCorridor *corridor)
{ {
if (_corridor != corridor) { if (_corridor != corridor) {
_corridor = corridor; _corridor = corridor;
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "QmlObjectListModel.h" #include "QmlObjectListModel.h"
#include "WimaArea.h" #include "WimaArea.h"
#include "WimaGOperationArea.h" #include "WimaMeasurementArea.h"
#include "WimaServiceArea.h" #include "WimaServiceArea.h"
#include "WimaVCorridor.h" #include "WimaCorridor.h"
class WimaDataContainer : public QObject class WimaDataContainer : public QObject
{ {
...@@ -18,30 +18,30 @@ public: ...@@ -18,30 +18,30 @@ public:
WimaDataContainer(WimaDataContainer &other) = delete; WimaDataContainer(WimaDataContainer &other) = delete;
const WimaArea * joinedArea (void) { return _joinedArea; } const WimaArea * joinedArea (void) { return _joinedArea; }
const WimaGOperationArea * opArea (void) { return _opArea; } const WimaMeasurementArea * opArea (void) { return _opArea; }
const WimaServiceArea * serArea (void) { return _serArea; } const WimaServiceArea * serArea (void) { return _serArea; }
const WimaVCorridor * corridor (void) { return _corridor; } const WimaCorridor * corridor (void) { return _corridor; }
const QmlObjectListModel * visualItems (void) { return _visualItems; } const QmlObjectListModel * visualItems (void) { return _visualItems; }
signals: signals:
void joinedAreaChanged (const WimaArea *area); void joinedAreaChanged (const WimaArea *area);
void opAreaChanged (const WimaGOperationArea *area); void opAreaChanged (const WimaMeasurementArea *area);
void serAreaChanged (const WimaServiceArea *area); void serAreaChanged (const WimaServiceArea *area);
void corridorChanged (const WimaVCorridor *area); void corridorChanged (const WimaCorridor *area);
void visualItemsChanged (const QmlObjectListModel *area); void visualItemsChanged (const QmlObjectListModel *area);
public slots: public slots:
void setJoinedArea (const WimaArea *joinedArea); void setJoinedArea (const WimaArea *joinedArea);
void setOpArea (const WimaGOperationArea *opArea); void setOpArea (const WimaMeasurementArea *opArea);
void setSerArea (const WimaServiceArea *serArea); void setSerArea (const WimaServiceArea *serArea);
void setCorridor (const WimaVCorridor *corridor); void setCorridor (const WimaCorridor *corridor);
void setVisualItems (const QmlObjectListModel *visualItems); void setVisualItems (const QmlObjectListModel *visualItems);
private: private:
const WimaArea *_joinedArea; const WimaArea *_joinedArea;
const WimaGOperationArea *_opArea; const WimaMeasurementArea *_opArea;
const WimaServiceArea *_serArea; const WimaServiceArea *_serArea;
const WimaVCorridor *_corridor; const WimaCorridor *_corridor;
const QmlObjectListModel *_visualItems; const QmlObjectListModel *_visualItems;
}; };
#pragma once
#include <QObject>
#include "WimaArea.h"
#include "SettingsFact.h"
#include "WimaTrackerPolyline.h"
#include "WimaGOperationArea.h"
#include "QScopedPointer"
class WimaGOperationArea : public WimaArea
{
Q_OBJECT
public:
WimaGOperationArea(QObject* parent = nullptr);
WimaGOperationArea(const WimaGOperationArea &other, QObject *parent = nullptr);
Q_PROPERTY(Fact* bottomLayerAltitude READ bottomLayerAltitudeFact CONSTANT)
Q_PROPERTY(Fact* numberOfLayers READ numberOfLayersFact CONSTANT)
Q_PROPERTY(Fact* layerDistance READ layerDistanceFact CONSTANT)
Q_PROPERTY(Fact* borderPolygonOffset READ borderPolygonOffsetFact CONSTANT)
Q_PROPERTY(QGCMapPolygon borderPolygon READ borderPolygon NOTIFY borderPolygonChanged)
// Overrides from WimaPolygon
QString mapVisualQML (void) const { return "WimaGOperationAreaMapVisual.qml";}
QString editorQML (void) const { return "WimaGOperationAreaEditor.qml";}
// Property accessors
Fact* bottomLayerAltitudeFact (void) { return &_bottomLayerAltitude;}
Fact* numberOfLayersFact (void) { return &_numberOfLayers;}
Fact* layerDistanceFact (void) { return &_layerDistance;}
Fact* borderPolygonOffsetFact (void) { return &_borderPolygonOffset;}
double bottomLayerAltitude (void) const { return _bottomLayerAltitude.rawValue().toDouble();}
int numberOfLayers (void) const { return _numberOfLayers.rawValue().toInt();}
double layerDistance (void) const { return _layerDistance.rawValue().toDouble();}
double borderPolygonOffset (void) const { return _borderPolygonOffset.rawValue().toDouble();}
QGCMapPolygon borderPolygon (void) const { return _borderPolygon;}
// Member Methodes
void saveToJson(QJsonObject& json);
bool loadFromJson(const QJsonObject& json, QString &errorString);
// Friends
friend void print(const WimaGOperationArea& area, QString outputStr);
friend void print(const WimaGOperationArea& area);
// Static Variables
static const char* settingsGroup;
static const char* bottomLayerAltitudeName;
static const char* numberOfLayersName;
static const char* layerDistanceName;
static const char* borderPolygonOffsetName;
static const char* wimaGOperationAreaName;
signals:
void bottomLayerAltitudeChanged (void);
void numberOfLayersChanged (void);
void layerDistanceChanged (void);
void polylineChanged (void);
void vehicleCorridorChanged (WimaVCorridor* corridor);
void borderPolygonChanged (void);
public slots:
/// Updates this with data from area
void update(const WimaGOperationArea &area);
void setBottomLayerAltitude (double altitude);
void setNumberOfLayers (double numLayers);
void setLayerDistance (double layerDistance);
void setBorderPolygonOffset (double offset);
private slots:
void recalcBorderPolygon (void);
private:
// Member Methodes
void init();
// Members
QMap<QString, FactMetaData*> _metaDataMap;
SettingsFact _bottomLayerAltitude;
SettingsFact _numberOfLayers;
SettingsFact _layerDistance;
SettingsFact _borderPolygonOffset;
QGCMapPolygon _borderPolygon;
};
#include "WimaMeasurementArea.h" #include "WimaMeasurementArea.h"
WimaMeasurementArea::WimaMeasurementArea()
const char* WimaMeasurementArea::settingsGroup = "OperationArea";
const char* WimaMeasurementArea::bottomLayerAltitudeName = "BottomLayerAltitude";
const char* WimaMeasurementArea::numberOfLayersName = "NumberOfLayers";
const char* WimaMeasurementArea::layerDistanceName = "LayerDistance";
const char* WimaMeasurementArea::borderPolygonOffsetName = "BorderPolygonOffset";
const char* WimaMeasurementArea::WimaMeasurementAreaName = "Operation Area";
WimaMeasurementArea::WimaMeasurementArea(QObject *parent)
: WimaArea (parent)
{
init();
}
WimaMeasurementArea::WimaMeasurementArea(const WimaMeasurementArea &other, QObject *parent)
: WimaArea(other, parent)
{
init();
}
void WimaMeasurementArea::saveToJson(QJsonObject &json)
{
this->WimaArea::saveToJson(json);
json[bottomLayerAltitudeName] = _bottomLayerAltitude.rawValue().toDouble();
json[numberOfLayersName] = _numberOfLayers.rawValue().toInt();
json[layerDistanceName] = _layerDistance.rawValue().toDouble();
json[borderPolygonOffsetName] = _borderPolygonOffset.rawValue().toDouble();
json[areaTypeName] = WimaMeasurementAreaName;
}
bool WimaMeasurementArea::loadFromJson(const QJsonObject &json, QString& errorString)
{ {
if (this->WimaArea::loadFromJson(json, errorString)) {
bool retVal = true;
if ( json.contains(bottomLayerAltitudeName) && json[bottomLayerAltitudeName].isDouble() ) {
_bottomLayerAltitude.setRawValue(json[bottomLayerAltitudeName].toDouble