Commit 9dc38c69 authored by Valentin Platzgummer's avatar Valentin Platzgummer

QmlObjectVectorModel added to WimaController

parent 32146c9e
......@@ -65,7 +65,7 @@ WimaController::WimaController(QObject *parent)
enableDisableLowBatteryHandling(enableLowBatteryHandling->rawValue());
}
QmlObjectListModel* WimaController::visualItems()
QmlObjectVectorModel* WimaController::visualItems()
{
return &_visualItems;
}
......@@ -92,7 +92,7 @@ WimaDataContainer *WimaController::dataContainer()
return _container;
}
QmlObjectListModel *WimaController::missionItems()
QmlObjectVectorModel *WimaController::missionItems()
{
return &_missionItems;
}
......@@ -376,12 +376,12 @@ bool WimaController::calcShortestPath(const QGeoCoordinate &start, const QGeoCoo
return retVal;
}
bool WimaController::extractCoordinateList(QmlObjectListModel &missionItems, QVector<QGeoCoordinate> &coordinateList)
bool WimaController::extractCoordinateList(QmlObjectVectorModel &missionItems, QVector<QGeoCoordinate> &coordinateList)
{
return extractCoordinateList(missionItems, coordinateList, 0, missionItems.count()-1);
}
bool WimaController::extractCoordinateList(QmlObjectListModel &missionItems, QVector<QGeoCoordinate> &coordinateList, int startIndex, int endIndex)
bool WimaController::extractCoordinateList(QmlObjectVectorModel &missionItems, QVector<QGeoCoordinate> &coordinateList, int startIndex, int endIndex)
{
if ( startIndex >= 0
&& startIndex < missionItems.count()
......@@ -409,12 +409,12 @@ bool WimaController::extractCoordinateList(QmlObjectListModel &missionItems, QVe
return true;
}
bool WimaController::extractCoordinateList(QmlObjectListModel &missionItems, QVariantList &coordinateList)
bool WimaController::extractCoordinateList(QmlObjectVectorModel &missionItems, QVariantList &coordinateList)
{
return extractCoordinateList(missionItems, coordinateList, 0 , missionItems.count()-1);
}
bool WimaController::extractCoordinateList(QmlObjectListModel &missionItems, QVariantList &coordinateList, int startIndex, int endIndex)
bool WimaController::extractCoordinateList(QmlObjectVectorModel &missionItems, QVariantList &coordinateList, int startIndex, int endIndex)
{
QVector<QGeoCoordinate> geoCoordintateList;
......@@ -744,8 +744,8 @@ bool WimaController::calcNextPhase()
updateAltitude();
qWarning() << "WimaController::calcNextPhase() exec time: "
<< std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now() - start).count() << " us";
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::high_resolution_clock::now() - start).count() << " ms";
return true;
}
......
......@@ -2,7 +2,7 @@
#include <QObject>
#include "QGCMapPolygon.h"
#include "QmlObjectListModel.h"
#include "QmlObjectVectorModel.h"
#include "WimaArea.h"
#include "WimaMeasurementArea.h"
......@@ -23,6 +23,7 @@
#include "SettingsFact.h"
#include "WimaSettings.h"
#include "SettingsManager.h"
#include "QmlObjectVectorModel.h"
class WimaController : public QObject
......@@ -37,13 +38,13 @@ public:
Q_PROPERTY(PlanMasterController* masterController READ masterController WRITE setMasterController NOTIFY masterControllerChanged)
Q_PROPERTY(MissionController* missionController READ missionController WRITE setMissionController NOTIFY missionControllerChanged)
Q_PROPERTY(QmlObjectListModel* visualItems READ visualItems NOTIFY visualItemsChanged)
Q_PROPERTY(QmlObjectVectorModel* visualItems READ visualItems NOTIFY visualItemsChanged)
Q_PROPERTY(QString currentFile READ currentFile NOTIFY currentFileChanged)
Q_PROPERTY(QStringList loadNameFilters READ loadNameFilters CONSTANT)
Q_PROPERTY(QStringList saveNameFilters READ saveNameFilters CONSTANT)
Q_PROPERTY(QString fileExtension READ fileExtension CONSTANT)
Q_PROPERTY(WimaDataContainer* dataContainer READ dataContainer WRITE setDataContainer NOTIFY dataContainerChanged)
Q_PROPERTY(QmlObjectListModel* missionItems READ missionItems NOTIFY missionItemsChanged)
Q_PROPERTY(QmlObjectVectorModel* missionItems READ missionItems NOTIFY missionItemsChanged)
Q_PROPERTY(QVariantList waypointPath READ waypointPath NOTIFY waypointPathChanged)
Q_PROPERTY(Fact* enableWimaController READ enableWimaController CONSTANT)
Q_PROPERTY(Fact* overlapWaypoints READ overlapWaypoints CONSTANT)
......@@ -65,14 +66,14 @@ public:
// Property accessors
PlanMasterController* masterController (void) { return _masterController; }
MissionController* missionController (void) { return _missionController; }
QmlObjectListModel* visualItems (void);
QmlObjectVectorModel* visualItems (void);
QString currentFile (void) const { return _currentFile; }
QStringList loadNameFilters (void) const;
QStringList saveNameFilters (void) const;
QString fileExtension (void) const { return wimaFileExtension; }
QGCMapPolygon joinedArea (void) const;
WimaDataContainer* dataContainer (void);
QmlObjectListModel* missionItems (void);
QmlObjectVectorModel* missionItems (void);
QVariantList waypointPath (void);
Fact* enableWimaController (void);
Fact* overlapWaypoints (void);
......@@ -137,13 +138,13 @@ public:
bool calcShortestPath(const QGeoCoordinate &start, const QGeoCoordinate &destination, QVector<QGeoCoordinate> &path);
/// extracts the coordinates stored in missionItems (list of MissionItems) and stores them in coordinateList
bool extractCoordinateList(QmlObjectListModel &missionItems, QVector<QGeoCoordinate> &coordinateList);
bool extractCoordinateList(QmlObjectVectorModel &missionItems, QVector<QGeoCoordinate> &coordinateList);
/// extracts the coordinates (between startIndex and endIndex) stored in missionItems (list of MissionItems) and stores them in coordinateList.
bool extractCoordinateList(QmlObjectListModel &missionItems, QVector<QGeoCoordinate> &coordinateList, int startIndex, int endIndex);
bool extractCoordinateList(QmlObjectVectorModel &missionItems, QVector<QGeoCoordinate> &coordinateList, int startIndex, int endIndex);
/// extracts the coordinates stored in missionItems (list of MissionItems) and stores them in coordinateList
bool extractCoordinateList(QmlObjectListModel &missionItems, QVariantList &coordinateList);
bool extractCoordinateList(QmlObjectVectorModel &missionItems, QVariantList &coordinateList);
/// extracts the coordinates (between startIndex and endIndex) stored in missionItems (list of MissionItems) and stores them in coordinateList.
bool extractCoordinateList(QmlObjectListModel &missionItems, QVariantList &coordinateList, int startIndex, int endIndex);
bool extractCoordinateList(QmlObjectVectorModel &missionItems, QVariantList &coordinateList, int startIndex, int endIndex);
signals:
void masterControllerChanged (void);
......@@ -191,14 +192,14 @@ private:
MissionController *_missionController;
QString _currentFile; // file for saveing
WimaDataContainer *_container; // container for data exchange with WimaController
QmlObjectListModel _visualItems; // contains all visible areas
QmlObjectVectorModel _visualItems; // contains all visible areas
WimaJoinedAreaData _joinedArea; // joined area fromed by opArea, serArea, _corridor
WimaMeasurementAreaData _measurementArea; // measurement area
WimaServiceAreaData _serviceArea; // area for supplying
WimaCorridorData _corridor; // corridor connecting opArea and serArea
bool _localPlanDataValid;
QmlObjectListModel _missionItems; // all mission itmes (Mission Items) generaded by wimaPlaner, displayed in flightView
QmlObjectListModel _missionItemsBuffer; // Buffer to store mission items, e.g. for storing _missionController->visualItems() when smartRTL() is invoked
QmlObjectVectorModel _missionItems; // all mission itmes (Mission Items) generaded by wimaPlaner, displayed in flightView
QmlObjectVectorModel _missionItemsBuffer; // Buffer to store mission items, e.g. for storing _missionController->visualItems() when smartRTL() is invoked
QVariantList _waypointPath; // path connecting the items in _missionItems
QGeoCoordinate _takeoffLandPostion;
......
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