Commit df842d09 authored by Pierre TILAK's avatar Pierre TILAK

Use current selected item as index for insert

parent bffdc8d0
...@@ -65,7 +65,14 @@ Item { ...@@ -65,7 +65,14 @@ Item {
coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces) coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces)
coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces) coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
coordinate.altitude = coordinate.altitude.toFixed(_decimalPlaces) coordinate.altitude = coordinate.altitude.toFixed(_decimalPlaces)
insertComplexMissionItem(complexItemName, coordinate, _missionController.visualItems.count) var next_index = _missionController.visualItemIndexFromSequenceNumber(_missionController.currentPlanViewIndex)+1
if(next_index ==1 && _missionController.visualItems.count >1){
console.log(next_index, _missionController.visualItems.count)
insertComplexMissionItem(complexItemName, coordinate, next_index+1)
}
else if(next_index <= _missionController.visualItems.count){
insertComplexMissionItem(complexItemName, coordinate, next_index)
}
} }
function insertComplexMissionItem(complexItemName, coordinate, index) { function insertComplexMissionItem(complexItemName, coordinate, index) {
...@@ -468,7 +475,14 @@ Item { ...@@ -468,7 +475,14 @@ Item {
switch (_editingLayer) { switch (_editingLayer) {
case _layerMission: case _layerMission:
if (_addWaypointOnClick) { if (_addWaypointOnClick) {
insertSimpleMissionItem(coordinate, _missionController.visualItems.count) var next_index = _missionController.visualItemIndexFromSequenceNumber(_missionController.currentPlanViewIndex)+1
if(next_index ==1 && _missionController.visualItems.count >1){
console.log(next_index, _missionController.visualItems.count)
insertSimpleMissionItem(coordinate, next_index+1)
}
else if(next_index <= _missionController.visualItems.count){
insertSimpleMissionItem(coordinate, next_index)
}
} else if (_addROIOnClick) { } else if (_addROIOnClick) {
_addROIOnClick = false _addROIOnClick = false
insertROIMissionItem(coordinate, _missionController.visualItems.count) insertROIMissionItem(coordinate, _missionController.visualItems.count)
......
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