Direct to - finally and completely fix
This commit is contained in:
parent
165174f276
commit
a12b16ff45
1 changed files with 16 additions and 4 deletions
|
@ -369,8 +369,11 @@ var flightPlanController = {
|
||||||
me.DirToIndex = me.currentToWptIndex.getValue() + 1;
|
me.DirToIndex = me.currentToWptIndex.getValue() + 1;
|
||||||
} else {
|
} else {
|
||||||
var indexWP = me.flightplans[plan].indexOfWP(waypointGhost);
|
var indexWP = me.flightplans[plan].indexOfWP(waypointGhost);
|
||||||
me.deleteTillIndex(waypointGhost, me.currentToWptIndex.getValue(), plan);
|
me.insertTP(plan, indexWP);
|
||||||
me.insertTP(plan, indexWP - 1);
|
me.deleteTillIndex(waypointGhost, me.currentToWptIndex.getValue(), plan, 1);
|
||||||
|
|
||||||
|
indexWP = me.flightplans[plan].indexOfWP(waypointGhost);
|
||||||
|
me.hideTillIndex(indexWP - 2, plan);
|
||||||
me.DirToIndex = indexWP;
|
me.DirToIndex = indexWP;
|
||||||
}
|
}
|
||||||
var curAircraftPosDirTo = geo.aircraft_position();
|
var curAircraftPosDirTo = geo.aircraft_position();
|
||||||
|
@ -405,8 +408,8 @@ var flightPlanController = {
|
||||||
# deleteTillIndex - helper that deletes waypoints up to a passed waypoint already in flightplan
|
# deleteTillIndex - helper that deletes waypoints up to a passed waypoint already in flightplan
|
||||||
# uses a while loop to delete a certain number of waypoints between passed index and
|
# uses a while loop to delete a certain number of waypoints between passed index and
|
||||||
# index of waypoint alredy in flightplan
|
# index of waypoint alredy in flightplan
|
||||||
deleteTillIndex: func(wpGhost, index, plan) {
|
deleteTillIndex: func(wpGhost, index, plan, offset = 0) {
|
||||||
var numToDel = me.flightplans[plan].indexOfWP(wpGhost) - index;
|
var numToDel = me.flightplans[plan].indexOfWP(wpGhost) - index - offset;
|
||||||
while (numToDel > 0) {
|
while (numToDel > 0) {
|
||||||
me.deleteWP(index, plan, 1);
|
me.deleteWP(index, plan, 1);
|
||||||
numToDel -= 1;
|
numToDel -= 1;
|
||||||
|
@ -414,6 +417,15 @@ var flightPlanController = {
|
||||||
return 2;
|
return 2;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hideTillIndex: func(index, plan) {
|
||||||
|
var numToDel = index;
|
||||||
|
while (numToDel >= 0) {
|
||||||
|
me.flightplans[plan].getWP(index - numToDel).hidden = 1;
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
},
|
||||||
|
|
||||||
# createDuplicateNames - helper to spawn DUPLICATENAMES page
|
# createDuplicateNames - helper to spawn DUPLICATENAMES page
|
||||||
# args: ghostContainer, index, flag, plan
|
# args: ghostContainer, index, flag, plan
|
||||||
# ghostContainer: vector of fgPositioned ghosts
|
# ghostContainer: vector of fgPositioned ghosts
|
||||||
|
|
Loading…
Reference in a new issue