Navdisplay: plan index - account for current waypoint index
This commit is contained in:
parent
1b329f19d9
commit
56bab27f46
3 changed files with 19 additions and 5 deletions
|
@ -1,3 +1,6 @@
|
|||
# A3XX MCDU Direct To Page
|
||||
# Copyright (c) 2022 Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
var dirToFlag = 0;
|
||||
|
||||
var dirTo = {
|
||||
|
@ -77,14 +80,14 @@ var dirTo = {
|
|||
canvas_mcdu.myFpln[me.computer] = fplnPage.new(2, me.computer);
|
||||
}
|
||||
|
||||
var x = 0;
|
||||
var dirToLeftIndex = 0;
|
||||
me.vector = [];
|
||||
for (var i = 1 + (me.scroll); i < size(canvas_mcdu.myFpln[me.computer].planList) - 2; i = i + 1) {
|
||||
if (canvas_mcdu.myFpln[me.computer].planList[i].wp == "PSEUDO" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_name == "DISCONTINUITY" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_name == "VECTORS" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_name == "T-P" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_type == "hdgToAlt") { continue; }
|
||||
if (canvas_mcdu.myFpln[me.computer].planList[i].index > fmgc.flightPlanController.arrivalIndex[2]) { continue; }
|
||||
append(me.vector, canvas_mcdu.myFpln[me.computer].planList[i].wp);
|
||||
x += 1;
|
||||
if (x == 4) { break; }
|
||||
dirToLeftIndex += 1;
|
||||
if (dirToLeftIndex == 4) { break; }
|
||||
}
|
||||
|
||||
if (size(me.vector) > 0) {
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
# A3XX FMGC Flightplan Page
|
||||
# Copyright (c) 2022 Josh Davidson (Octal450) and Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
# Local vars
|
||||
var decelIndex = 0;
|
||||
var decelShow = 0;
|
||||
var destName = nil;
|
||||
|
||||
var getSubTextFunc = func(meRef) {
|
||||
var subText = nil;
|
||||
call(func {
|
||||
|
@ -526,7 +534,7 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
},
|
||||
destInfo: func() {
|
||||
if (me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]) != nil) {
|
||||
var destName = split("-", me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]).wp_name);
|
||||
destName = split("-", me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]).wp_name);
|
||||
if (size(destName) == 2) {
|
||||
me.L6 = [destName[0] ~ destName[1], " DEST", "wht"];
|
||||
} else {
|
||||
|
@ -554,8 +562,8 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
|||
if (me.scroll > decelIndex) {
|
||||
decelOffset = 1;
|
||||
}
|
||||
setprop("/instrumentation/efis[" ~ me.computer ~ "]/inputs/plan-wpt-index", me.scroll - decelOffset);
|
||||
}
|
||||
setprop("/instrumentation/efis[" ~ me.computer ~ "]/inputs/plan-wpt-index", (fmgc.flightPlanController.currentToWptIndex.getValue() - 1 + me.scroll - decelOffset));
|
||||
}
|
||||
},
|
||||
scrollUp: func() {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
# A3XX MCDU Received Messages Page
|
||||
# Copyright (c) 2022 Jonathan Redpath (legoboyvdlp)
|
||||
|
||||
var receivedMessagesPage = {
|
||||
title: nil,
|
||||
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||
|
|
Loading…
Reference in a new issue