Commit 6bde4d9c authored by Valentin Platzgummer's avatar Valentin Platzgummer

new classes added, WimaPolygon etc.

parent 8a995243
......@@ -408,7 +408,12 @@ HEADERS += \
src/comm/MavlinkMessagesTimer.h \
src/GPS/Drivers/src/base_station.h \
src/MissionManager/WimaController.h \
src/MissionManager/WimaFlyArea.h
src/MissionManager/WimaFlyArea.h \
src/MissionManager/WimaPolygon.h \
src/MissionManager/WimaServicePolygon.h \
src/MissionManager/WimaVehicleCorridor.h \
src/MissionManager/WimaVehicleMeasurementPolygon.h \
src/MissionManager/WimaGlobalMeasurementPolygon.h
SOURCES += \
src/api/QGCCorePlugin.cc \
......@@ -417,7 +422,12 @@ SOURCES += \
src/api/QmlComponentInfo.cc \
src/comm/MavlinkMessagesTimer.cc \
src/MissionManager/WimaController.cc \
src/MissionManager/WimaFlyArea.cc
src/MissionManager/WimaFlyArea.cc \
src/MissionManager/WimaPolygon.cc \
src/MissionManager/WimaServicePolygon.cc \
src/MissionManager/WimaVehicleCorridor.cc \
src/MissionManager/WimaVehicleMeasurementPolygon.cc \
src/MissionManager/WimaGlobalMeasurementPolygon.cc
#
# Unit Test specific configuration goes here (requires full debug build with all plugins)
......
......@@ -11,5 +11,22 @@ void WimaController::start()
_flyArea->_init();
}
void WimaController::recalcMission()
{
}
void WimaController::setMasterController(PlanMasterController *masterC)
{
_masterController = masterC;
emit masterControllerChanged(_masterController);
}
void WimaController::setMissionController(MissionController *missionC)
{
_missionController = missionC;
emit missionControllerChanged(_missionController);
}
......@@ -5,6 +5,8 @@
#include "QGCMapPolygon.h"
#include "QmlObjectListModel.h"
#include "WimaFlyArea.h"
#include "PlanMasterController.h"
#include "MissionController.h"
class WimaController : public QObject
{
......@@ -12,25 +14,37 @@ class WimaController : public QObject
public:
explicit WimaController(QObject *parent = nullptr);
Q_PROPERTY(WimaFlyArea *flyArea READ flyArea CONSTANT)
//Q_PROPERTY(QmlObjectListModel* visualItems READ visualItems NOTIFY visualItemsChanged)
Q_PROPERTY(WimaFlyArea* flyArea READ flyArea CONSTANT)
Q_PROPERTY(PlanMasterController* masterController READ masterController WRITE setMasterController NOTIFY masterControllerChanged)
Q_PROPERTY(MissionController* missionController READ missionController WRITE setMissionController NOTIFY missionControllerChanged)
//Property Accessors
WimaFlyArea *flyArea (void) { return _flyArea; }
//QmlObjectListModel* visualItems (void) { return _visualItems; }
WimaFlyArea *flyArea (void) { return _flyArea; }
PlanMasterController* masterController (void) { return _masterController; }
MissionController* missionController (void) { return _missionController; }
Q_INVOKABLE void start(void);
Q_INVOKABLE void recalcMission();
void setMasterController(PlanMasterController* masterC);
void setMissionController(MissionController* missionC);
signals:
void masterControllerChanged(PlanMasterController* masterController);
void missionControllerChanged(MissionController* missionController);
public slots:
private:
//QmlObjectListModel* _visualItems;
WimaFlyArea * _flyArea;
WimaFlyArea * _flyArea;
PlanMasterController* _masterController;
MissionController* _missionController;
};
#endif // WIMACONTROLLER_H
......@@ -30,7 +30,7 @@ void WimaFlyArea::appendFlyAreaPolygon()
_polygons->append(newPolygon);
int index = _polygons->count()-1;
setCurrentPolygon(index);
selectCurrentPolygon(index);
emit polygonsChanged();
}
......@@ -44,16 +44,11 @@ void WimaFlyArea::removeFlyAreaPolygon(int index)
}
}
void WimaFlyArea::setCurrentPolygon(int index)
void WimaFlyArea::selectCurrentPolygon(int index)
{
if(index >= 0 && index < _polygons->count()) {
for (int i = 0; i < _polygons->count(); i++) {
QGCMapPolygon* polygon = qobject_cast<QGCMapPolygon*>(_polygons->get(i));
polygon->setInteractive(false);
}
disselectAllPolygons();
_currentPolygonIndex = index;
_currentPolygonItem = qobject_cast<QGCMapPolygon*>(_polygons->get(index));
......@@ -67,3 +62,20 @@ void WimaFlyArea::setCurrentPolygon(int index)
}
}
void WimaFlyArea::disselectAllPolygons()
{
for (int i = 0; i < _polygons->count(); i++) {
QGCMapPolygon* polygon = qobject_cast<QGCMapPolygon*>(_polygons->get(i));
polygon->setInteractive(false);
}
}
/*void WimaFlyArea::setBottomLayerAltitude(double alt)
{
if(_bottomLayerAltitude != alt){
_bottomLayerAltitude = alt;
emit bottomLayerAltitudeChanged(_bottomLayerAltitude);
}
}*/
......@@ -16,18 +16,30 @@ public:
Q_PROPERTY(QmlObjectListModel *polygons READ polygons NOTIFY polygonsChanged)
Q_PROPERTY(QGCMapPolygon *currentPolygonItem READ currentPolygonItem NOTIFY currentPolygonItemChanged)
Q_PROPERTY(int currentPolygonIndex READ currentPolygonIndex NOTIFY currentPolygonIndexChanged)
Q_PROPERTY(QmlObjectListModel* polygons READ polygons NOTIFY polygonsChanged)
Q_PROPERTY(QGCMapPolygon* currentPolygonItem READ currentPolygonItem NOTIFY currentPolygonItemChanged)
Q_PROPERTY(int currentPolygonIndex READ currentPolygonIndex NOTIFY currentPolygonIndexChanged)
//Q_PROPERTY(QList<double>* bottomLayerAltitude READ bottomLayerAltitude WRITE setBottomLayerAltitude NOTIFY bottomLayerAltitudeChanged)
//Q_PROPERTY(QList<int>* layerNumber READ layerNumber WRITE setLayerNumber NOTIFY layerNumberChanged)
//Q_PROPERTY(QList<double>* layerDistance READ layerDistance WRITE setLayerDistance NOTIFY layerDistanceChanged)
Q_INVOKABLE void appendFlyAreaPolygon();
Q_INVOKABLE void removeFlyAreaPolygon(int index);
Q_INVOKABLE void setCurrentPolygon(int index);
Q_INVOKABLE void selectCurrentPolygon(int index);
Q_INVOKABLE void disselectAllPolygons();
// Property Accessors
QmlObjectListModel * polygons (void) { return _polygons;}
QGCMapPolygon * currentPolygonItem (void) { return _currentPolygonItem;}
int currentPolygonIndex (void) { return _currentPolygonIndex;}
//QList<double>* bottomLayerAltitude (void) { return _bottomLayerAltitude;}
//QList<int>* layerNumber (void) { return _layerNumber;}
//QList<double>* layerDistance (void) { return _layerDistance;}
// Property Writers
//void setBottomLayerAltitude(double alt);
//void setLayerNumber(int layerNumber);
//void setLayerDistance(double dist);
// Methodes
......@@ -37,6 +49,9 @@ signals:
void polygonsChanged(void);
void currentPolygonItemChanged(QGCMapPolygon * polygon);
void currentPolygonIndexChanged(int index);
void bottomLayerAltitudeChanged(double alt);
void layerNumberChanged(int alt);
void layerDistanceChanged(double dist);
public slots:
......@@ -48,6 +63,10 @@ private:
QmlObjectListModel* _polygons;
QGCMapPolygon* _currentPolygonItem;
int _currentPolygonIndex;
bool _visible;
//QList<double>* _bottomLayerAltitude;
//QList<int>* _layerNumber;
//QList<double>* _layerDistance;
};
......
#include "WimaGlobalMeasurementPolygon.h"
WimaGlobalMeasurementPolygon::WimaGlobalMeasurementPolygon(QObject *parent):
WimaPolygon (parent)
{
}
void WimaGlobalMeasurementPolygon::addVehicle(Vehicle *vehicle)
{
if(vehicle != nullptr){
_vehicleList->append(vehicle);
emit vehicleListChanged(_vehicleList);
}
}
void WimaGlobalMeasurementPolygon::removeVehicle(int vehicleIndex)
{
if(vehicleIndex >= 0 && vehicleIndex < _vehicleList->count()){
_vehicleList->removeAt(vehicleIndex);
emit vehicleListChanged(_vehicleList);
}
}
void WimaGlobalMeasurementPolygon::recalculateVehiclePolygons()
{
int vehicleCount = _vehicleList->count();
WimaVehicleMeasurementPolygon* newPolygon = new WimaVehicleMeasurementPolygon(this);
_vehiclePolygons = this->splitPolygonArea(vehicleCount);
}
void WimaGlobalMeasurementPolygon::removeAllVehicles()
{
int counter = _vehicleList->count()-1;
while(counter >= 0){
_vehicleList->removeAt(0);
counter--;
}
emit vehicleListChanged(_vehicleList);
}
void WimaGlobalMeasurementPolygon::setBottomLayerAltitude(double altitude)
{
if(altitude > 0 && altitude != _bottomLayerAltitude){
_bottomLayerAltitude = altitude;
emit bottomLayerAltitudeChanged(altitude);
}
}
void WimaGlobalMeasurementPolygon::setNumberOfLayers(int numberOfLayers)
{
if(numberOfLayers > 0 && _numberOfLayers != numberOfLayers){
_numberOfLayers = numberOfLayers;
emit numberOfLayersChanged(numberOfLayers);
}
}
void WimaGlobalMeasurementPolygon::setLayerDistance(double distance)
{
if(distance > 0 && distance != _layerDistance){
_layerDistance = distance;
emit layerDistanceChanged(distance);
}
}
#ifndef WIMAGLOBALMEASUREMENTPOLYGON_H
#define WIMAGLOBALMEASUREMENTPOLYGON_H
#include <QObject>
#include "WimaPolygon.h"
#include "QGCMapPolyline.h"
#include "WimaVehicleMeasurementPolygon.h"
class WimaGlobalMeasurementPolygon : public WimaPolygon
{
Q_OBJECT
public:
WimaGlobalMeasurementPolygon(QObject* parent);
Q_PROPERTY(double bottomLayerAltitude READ bottomLayerAltitude WRITE setBottomLayerAltitude NOTIFY bottomLayerAltitudeChanged)
Q_PROPERTY(int numberOfLayers READ numberOfLayers WRITE setNumberOfLayers NOTIFY numberOfLayersChanged)
Q_PROPERTY(double layerDistance READ layerDistance WRITE setLayerDistance NOTIFY layerDistanceChanged)
Q_PROPERTY(QmlObjectListModel* vehicleList READ vehicleList NOTIFY vehicleListChanged)
Q_PROPERTY(QGCMapPolyline* entryPolyline READ entryPolyline NOTIFY entryPolylineChanged)
Q_PROPERTY(QmlObjectListModel* vehiclePolygons READ vehiclePolygons NOTIFY vehiclePolygonsChanged)
Q_INVOKABLE void addVehicle(Vehicle *vehicle);
Q_INVOKABLE void removeVehicle(int vehicleIndex);
Q_INVOKABLE void recalculateVehiclePolygons();
Q_INVOKABLE void removeAllVehicles();
// Overrides from WimaPolygon
QString mapVisualQML (void) const { return "WimaGlobalMeasurementPolygonMapVisal.qml";}
QString editorQML (void) const { return "WimaGlobalMeasurementPolygonEditor.qml";}
// Property accessors
double bottomLayerAltitude (void) const { return _bottomLayerAltitude;}
int numberOfLayers (void) const { return _numberOfLayers;}
double layerDistance (void) const { return _layerDistance;}
QmlObjectListModel* vehicleList (void) const { return _vehicleList;}
QGCMapPolyline* entryPolyline (void) const { return _entryPolyline;}
QmlObjectListModel* vehiclePolygons (void) const { return _vehiclePolygons;}
// Property setters
void setBottomLayerAltitude(double altitude);
void setNumberOfLayers(int numberOfLayers);
void setLayerDistance(double distance);
signals:
void bottomLayerAltitudeChanged(double altitude);
void numberOfLayersChanged(int numberOfLayers);
void layerDistanceChanged(double distance);
void vehicleListChanged(QmlObjectListModel* vehicleList);
void entryPolylineChanged(QGCMapPolyline* polyline);
void vehiclePolygonsChanged(QmlObjectListModel* vehiclePolygons);
private:
double _bottomLayerAltitude;
int _numberOfLayers;
double _layerDistance;
QmlObjectListModel* _vehicleList;
QGCMapPolyline* _entryPolyline;
QmlObjectListModel* _vehiclePolygons;
};
#endif // WIMAGLOBALMEASUREMENTPOLYGON_H
#include "WimaPolygon.h"
WimaPolygon::WimaPolygon(QObject *parent) :
QGCMapPolygon (parent)
,_maxAltitude (30)
,_vehicle (nullptr)
,_polygonFractions (new QmlObjectListModel(this))
{
}
void WimaPolygon::setMaxAltitude(double alt)
{
if(alt > 0 && alt != _maxAltitude){
_maxAltitude = alt;
emit maxAltitudeChanged(_maxAltitude);
}
}
void WimaPolygon::setVehicle(Vehicle *vehicle)
{
if(_vehicle != vehicle){
_vehicle = vehicle;
emit vehicleChanged(_vehicle);
}
}
QmlObjectListModel* WimaPolygon::splitPolygonArea(int numberOfFractions)
{
if(numberOfFractions > 0){
_polygonFractions->append(this);
emit polygonFractionsChanged(_polygonFractions);
return _polygonFractions;
}
return nullptr;
}
QGCMapPolygon *WimaPolygon::extractQGCPolygon()
{
QGCMapPolygon* newPolygon = new QGCMapPolygon(this->parent());
}
#ifndef WIMAPOLYGON_H
#define WIMAPOLYGON_H
#include "QGCMapPolygon.h"
#include "Vehicle.h"
class WimaPolygon : public QGCMapPolygon //abstract base class for all WimaPolygons
{
Q_OBJECT
public:
WimaPolygon(QObject* parent = nullptr);
Q_PROPERTY(double maxAltitude READ maxAltitude WRITE setMaxAltitude NOTIFY maxAltitudeChanged)
Q_PROPERTY(QString mapVisualQML READ mapVisualQML CONSTANT)
Q_PROPERTY(QString editorQML READ editorQML CONSTANT)
Q_PROPERTY(Vehicle* vehicle READ vehicle WRITE setVehicle NOTIFY vehicleChanged)
Q_PROPERTY(QmlObjectListModel* polygonFractions READ polygonFractions NOTIFY polygonFractionsChanged)
//Property accessors
double maxAltitude (void) const { return _maxAltitude;}
Vehicle* vehicle (void) const { return _vehicle;}
virtual QString mapVisualQML (void) const = 0;
virtual QString editorQML (void) const = 0;
//Property setters
void setMaxAltitude (double alt);
void setName (QString name);
void setVehicle (Vehicle* vehicle);
/// Splits the polygon in numberOfFractions fractions with equal area.
/// @param polygonFractions The polygon List to add the fractions to.
/// @param numberOfFractions The number of fractions to split the polygon to.
Q_INVOKABLE QmlObjectListModel* splitPolygonArea(int numberOfFractions);
signals:
void maxAltitudeChanged (double alt);
void vehicleChanged (Vehicle* vehicle);
void polygonFractionsChanged (QmlObjectListModel* pfrac);
protected:
QGCMapPolygon* extractQGCPolygon(void);
private:
double _maxAltitude;
Vehicle* _vehicle;
QmlObjectListModel* _polygonFractions;
};
#endif // WIMAPOLYGON_H
#include "WimaServicePolygon.h"
WimaServicePolygon::WimaServicePolygon(QObject *parent):
WimaPolygon (parent)
{
}
void WimaServicePolygon::setTakeOffPosition(QGeoCoordinate coordinate)
{
if(_takeOffPosition != coordinate){
_takeOffPosition = coordinate;
emit takeOffPositionChanged(coordinate);
}
}
void WimaServicePolygon::setLandPosition(QGeoCoordinate coordinate)
{
if(_landPosition != coordinate){
_landPosition = coordinate;
emit landPositionChanged(coordinate);
}
}
void WimaServicePolygon::setVehicle(Vehicle *vehicle)
{
if(_vehicle != vehicle){
_vehicle = vehicle;
emit vehicleChanged(vehicle);
}
}
#ifndef WIMASERVICEPOLYGON_H
#define WIMASERVICEPOLYGON_H
#include "QObject"
#include "WimaPolygon.h"
class WimaServicePolygon : public WimaPolygon
{
Q_OBJECT
public:
WimaServicePolygon(QObject* parent);
Q_PROPERTY(QGeoCoordiante takeOffPosition READ takeOffPosition WRITE setTakeOffPosition NOTIFY takeOffPositionChanged)
Q_PROPERTY(QGeoCoordinate landPosition READ landPosition WRITE setLandPosition NOTIFY landPositionChanged)
Q_PROPERTY(Vehicle* vehicle READ vehicle WRITE setVehicle NOTIFY vehicleChanged)
// Overrides from WimaPolygon
QString mapVisualQML (void) const { return "WimaServicePolygonMapVisal.qml";}
QString editorQML (void) const { return "WimaServicePolygonEditor.qml";}
// Property acessors
QGeoCoordinate takeOffPosition (void) const { return _takeOffPosition;}
QGeoCoordinate landPosition (void) const { return _landPosition;}
Vehicle* vehicle (void) const { return _vehicle;}
// Property setters
void setTakeOffPosition (QGeoCoordinate coordinate);
void setLandPosition (QGeoCoordinate coordinate);
void setVehicle (Vehicle* vehicle);
signals:
void takeOffPositionChanged (QGeoCoordinate takeOffPos);
void landPositionChanged (QGeoCoordinate landPos);
void vehicleChanged (Vehicle* vehicle);
private:
QGeoCoordinate _takeOffPosition;
QGeoCoordinate _landPosition;
Vehicle* _vehicle;
};
#endif // WIMASERVICEPOLYGON_H
#include "WimaVehicleCorridor.h"
WimaVehicleCorridor::WimaVehicleCorridor(QObject *parent):
WimaPolygon(parent)
{
}
#ifndef WIMAVEHICLECORRIDOR_H
#define WIMAVEHICLECORRIDOR_H
#include <QObject>
#include "WimaPolygon.h"
class WimaVehicleCorridor : public WimaPolygon
{
Q_OBJECT
public:
WimaVehicleCorridor(QObject* parent);
// Overrides from WimaPolygon
QString mapVisualQML (void) const { return "WimaVehicleCorridorMapVisal.qml";}
QString editorQML (void) const { return "WimaVehicleCorridorEditor.qml";}
};
#endif // WIMAVEHICLECORRIDOR_H
#include "WimaVehicleMeasurementPolygon.h"
WimaVehicleMeasurementPolygon::WimaVehicleMeasurementPolygon(QObject *parent):
WimaPolygon (parent)
{
}
#ifndef WIMAVEHICLEMEASUREMENTPOLYGON_H
#define WIMAVEHICLEMEASUREMENTPOLYGON_H
#include <QObject>
#include "WimaPolygon.h"
class WimaVehicleMeasurementPolygon : public WimaPolygon
{
Q_OBJECT
public:
WimaVehicleMeasurementPolygon(QObject* parent);
// Overrides from WimaPolygon
QString mapVisualQML (void) const { return "WimaVehicleMeasurementPolygonMapVisal.qml";}
QString editorQML (void) const { return "WimaVehicleMeasurementPolygonEditor.qml";}
};
#endif // WIMAVEHICLEMEASUREMENTPOLYGON_H
......@@ -23,7 +23,6 @@ Rectangle {
// The following properties must be available up the hierarchy chain
//property real availableWidth ///< Width for control
//property var missionItem ///< Mission Item for editor
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5
......
......@@ -12,10 +12,10 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
/// Mission item edit control
/// Fly Area Item edit control
Rectangle {
id: _root
height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (commandPicker.y + commandPicker.height + _margin / 2)
height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (descriptionLabel.y + descriptionLabel.height + _margin / 2)
color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade
radius: _radius
......@@ -25,13 +25,14 @@ Rectangle {
property var polygon ///< MissionItem associated with this editor
property bool readOnly ///< true: read only view, false: full editing view
property var rootQgcView
property int _index
signal clicked
signal remove
property var _masterController: masterController
property var _missionController: _masterController.missionController
property bool _currentItem: flyArea.currentPolygonIndex === index
property bool _currentItem: polygon.interactive
property color _outerTextColor: _currentItem ? qgcPal.primaryButtonText : qgcPal.text
property bool _noMissionItemsAdded: ListView.view.model.count === 1
property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings
......@@ -39,7 +40,7 @@ Rectangle {
readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12)
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2
readonly property real _hamburgerSize: commandPicker.height * 0.75
readonly property real _hamburgerSize: descriptionLabel.height * 0.75
readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly
QGCPalette {
......@@ -63,7 +64,7 @@ Rectangle {
QGCLabel {
id: label
anchors.verticalCenter: commandPicker.verticalCenter
anchors.verticalCenter: descriptionLabel.verticalCenter
anchors.leftMargin: _margin
anchors.left: parent.left
text: index
......@@ -74,7 +75,7 @@ Rectangle {
id: hamburger
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.right: parent.right
anchors.verticalCenter: commandPicker.verticalCenter
anchors.verticalCenter: descriptionLabel.verticalCenter
width: _hamburgerSize
height: _hamburgerSize
sourceSize.height: _hamburgerSize
......@@ -99,46 +100,38 @@ Rectangle {
onTriggered: flyArea.appendFlyAreaPolygon()
}
MenuItem {
text: qsTr("Delete")
onTriggered: remove()
}
MenuItem {
text: qsTr("Copy Fly Area")
//onTriggered: //To Do
}
}
}
QGCButton {
id: commandPicker
QGCLabel {
id: descriptionLabel
anchors.topMargin: _margin / 2
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
anchors.rightMargin: ScreenTools.defaultFontPixelWidth
anchors.left: label.right
anchors.top: parent.top
visible: !commandLabel.visible
text: "Fly Area"
verticalAlignment: Text.AlignVCenter
color: _outerTextColor
}
QGCLabel {
id: commandLabel
anchors.fill: commandPicker
visible: _currentItem
verticalAlignment: Text.AlignVCenter
text: "Fly Area"
color: _outerTextColor
}
Loader {
id: editorLoader
anchors.leftMargin: _margin
anchors.topMargin: _margin
anchors.left: parent.left
anchors.top: commandPicker.bottom
anchors.top: descriptionLabel.bottom
source: "FlyAreaEditor.qml"
visible: _currentItem
......
......@@ -74,6 +74,8 @@ QGCView {
Component.onCompleted: {
toolbar.planMasterController = Qt.binding(function () { return _planMasterController })
toolbar.currentMissionItem = Qt.binding(function () { return _missionController.currentPlanViewItem })
_wimaController.masterController = Qt.binding(function () { return _planMasterController})
_wimaController.missionController = Qt.binding(function () { return _planMasterController.missionController})
}
function updateAirspace(reset) {
......@@ -806,20 +808,21 @@ QGCView {
//-- List Elements
delegate: FlyAreaItemEditor {
map: editorMap
masterController: _planMasterController
masterController: _planMasterController
flyArea: _flyArea
_index: index
polygon: object
width: parent.width
readOnly: false
rootQgcView: _qgcView
onClicked: _flyArea.setCurrentPolygon(index)
onClicked: _flyArea.selectCurrentPolygon(index)
onRemove: {
var removeIndex = index
_flyArea.removeFlyAreaPolygon(removeIndex)