1
0
Fork 0

Re-format ARRIVAL page for approach VIAS

This commit is contained in:
legoboyvdlp R 2020-05-31 23:39:09 +01:00
parent 98163eb712
commit 78b78487b1
2 changed files with 135 additions and 101 deletions

View file

@ -3603,7 +3603,6 @@ var canvas_MCDU_base = {
me["ArrowRight"].show(); me["ArrowRight"].show();
me["arrowsDepArr"].show(); me["arrowsDepArr"].show();
me["Simple_L1_Arrow"].hide(); me["Simple_L1_Arrow"].hide();
me["Simple_L2_Arrow"].hide();
me["Simple_L3_Arrow"].hide(); me["Simple_L3_Arrow"].hide();
me["Simple_L4_Arrow"].hide(); me["Simple_L4_Arrow"].hide();
me["Simple_L5_Arrow"].hide(); me["Simple_L5_Arrow"].hide();
@ -3630,6 +3629,12 @@ var canvas_MCDU_base = {
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht"); me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
if (myArrival[i].arrowsMatrix[0][1]) {
me["Simple_L2_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][1] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][1] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][1] ~ "/b"));
me["Simple_L2_Arrow"].show();
} else {
me["Simple_L2_Arrow"].hide();
}
if (myArrival[i] != nil) { if (myArrival[i] != nil) {
me["Simple_Title"].setText(sprintf("%s", myArrival[i].title[0] ~ myArrival[i].title[1] ~ myArrival[i].title[2])); me["Simple_Title"].setText(sprintf("%s", myArrival[i].title[0] ~ myArrival[i].title[1] ~ myArrival[i].title[2]));
@ -3641,6 +3646,7 @@ var canvas_MCDU_base = {
var sign = "R"; var sign = "R";
} }
forindex (var item; myArrival[i].arrowsMatrix[matrixArrow]) { forindex (var item; myArrival[i].arrowsMatrix[matrixArrow]) {
if (item == 1) { continue; }
if (item == 5) { if (item == 5) {
me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/b")); me["Simple_L6_Arrow"].setColor(getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/r"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/g"), getprop("/MCDUC/colors/" ~ myArrival[i].arrowsColour[0][5] ~ "/b"));
continue; continue;

View file

@ -38,12 +38,13 @@ var arrivalPage = {
computer: nil, computer: nil,
enableScrollApproach: 0, enableScrollApproach: 0,
enableScrollStars: 0, enableScrollStars: 0,
enableScrollVias: 0,
scrollApproach: 0, scrollApproach: 0,
scrollStars: 0, scrollStars: 0,
activePage: 0, # runways, stars, vias activePage: 0, # runways, stars, vias
hasPressNoTrans: 0, # temporary hasPressNoTrans: 0, # temporary
_approaches: nil, _approaches: nil,
_vias; nil, _vias: nil,
_stars: nil, _stars: nil,
_transitions: nil, _transitions: nil,
new: func(icao, computer) { new: func(icao, computer) {
@ -66,6 +67,9 @@ var arrivalPage = {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) { if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
if (fmgc.flightPlanController.flightplans[2].approach != nil) { if (fmgc.flightPlanController.flightplans[2].approach != nil) {
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach; me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
}
} }
if (fmgc.flightPlanController.flightplans[2].star != nil) { if (fmgc.flightPlanController.flightplans[2].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star; me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
@ -77,8 +81,14 @@ var arrivalPage = {
} else { } else {
if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) { if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach; me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach;
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans;
}
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil) { } elsif (fmgc.flightPlanController.flightplans[2].approach != nil) {
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach; me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
}
} }
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) { if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star; me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star;
@ -113,8 +123,10 @@ var arrivalPage = {
} else { } else {
me.updateSTARs(); me.updateSTARs();
} }
me.checkPageType();
me.updateActiveApproach(); me.updateActiveApproach();
me.updateActiveVIAs();
me.updateActiveSTARs(); me.updateActiveSTARs();
me.updateActiveTransitions(); me.updateActiveTransitions();
}, },
@ -153,13 +165,13 @@ var arrivalPage = {
} elsif (fmgc.flightPlanController.flightplans[2].destination_runway != nil) { } elsif (fmgc.flightPlanController.flightplans[2].destination_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "grn"]; me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "grn"];
} else { } else {
me.L1 = ["---", " APPR", "wht"]; me.L1 = ["-----", " APPR", "wht"];
} }
} else { } else {
if (fmgc.flightPlanController.flightplans[me.computer].destination_runway != nil) { if (fmgc.flightPlanController.flightplans[me.computer].destination_runway != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].destination_runway.id, " APPR", "yel"]; me.L1 = [fmgc.flightPlanController.flightplans[me.computer].destination_runway.id, " APPR", "yel"];
} else { } else {
me.L1 = ["---", " APPR", "wht"]; me.L1 = ["-----", " APPR", "wht"];
} }
} }
} elsif (me.selectedApproach != nil) { } elsif (me.selectedApproach != nil) {
@ -169,41 +181,41 @@ var arrivalPage = {
} elsif (fmgc.flightPlanController.flightplans[2].approach.id == me.selectedApproach.id) { } elsif (fmgc.flightPlanController.flightplans[2].approach.id == me.selectedApproach.id) {
me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "grn"]; me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "grn"];
} else { } else {
me.L1 = ["---", " APPR", "wht"]; me.L1 = ["-----", " APPR", "wht"];
} }
} elsif (fmgc.flightPlanController.flightplans[me.computer].approach != nil) { } elsif (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].approach.id, " APPR", "yel"]; me.L1 = [fmgc.flightPlanController.flightplans[me.computer].approach.id, " APPR", "yel"];
} else { } else {
me.L1 = ["---", " APPR", "wht"]; me.L1 = ["-----", " APPR", "wht"];
} }
} else { } else {
me.L1 = ["---", " APPR", "wht"]; me.L1 = ["-----", " APPR", "wht"];
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}, },
updateActiveSTARs: func() { updateActiveSTARs: func() {
if (me.selectedSTAR == "NO STAR") { if (me.selectedSTAR == "NO STAR") {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) { if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.C1 = ["NONE", "STAR", "grn"]; me.R1 = ["NONE", "STAR ", "grn"];
} else { } else {
me.C1 = ["NONE", "STAR", "yel"]; me.R1 = ["NONE", "STAR ", "yel"];
} }
} elsif (me.selectedSTAR != nil) { } elsif (me.selectedSTAR != nil) {
if (fmgc.flightPlanController.flightplans[2].star != nil) { if (fmgc.flightPlanController.flightplans[2].star != nil) {
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) { if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR", "yel"]; me.R1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR ", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].star.id == me.selectedSTAR.id) { } elsif (fmgc.flightPlanController.flightplans[2].star.id == me.selectedSTAR.id) {
me.C1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR", "grn"]; me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "grn"];
} else { } else {
me.C1 = ["------- ", "STAR", "wht"]; me.R1 = ["-------", "STAR ", "wht"];
} }
} elsif (fmgc.flightPlanController.flightplans[me.computer].star.id != nil) { } elsif (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR", "yel"]; me.R1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "STAR ", "yel"];
} else { } else {
me.C1 = ["------- ", "STAR", "wht"]; me.R1 = ["-------", "STAR ", "wht"];
} }
} else { } else {
me.C1 = ["------- ", "STAR", "wht"]; me.R1 = ["-------", "STAR ", "wht"];
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}, },
@ -212,25 +224,25 @@ var arrivalPage = {
if (me.selectedTransition != nil) { if (me.selectedTransition != nil) {
if (fmgc.flightPlanController.flightplans[2].star_trans != nil) { if (fmgc.flightPlanController.flightplans[2].star_trans != nil) {
if (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) { if (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "TRANS", "yel"]; me.R2 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "TRANS ", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].star_trans.id == me.selectedTransition.id) { } elsif (fmgc.flightPlanController.flightplans[2].star_trans.id == me.selectedTransition.id) {
me.R1 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS", "grn"]; me.R2 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS ", "grn"];
} else { } else {
me.R1 = ["-------", "TRANS ", "wht"]; me.R2 = ["-------", "TRANS ", "wht"];
} }
} elsif (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) { } elsif (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "STAR", "yel"]; me.R2 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "TRANS ", "yel"];
} else { } else {
me.R1 = ["-------", "TRANS ", "wht"]; me.R2 = ["-------", "TRANS ", "wht"];
} }
} else { } else {
me.R1 = ["-------", "TRANS ", "wht"]; me.R2 = ["-------", "TRANS ", "wht"];
} }
} else { } else {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) { if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.R1 = ["NONE", "TRANS ", "grn"]; me.R2 = ["NONE", "TRANS ", "grn"];
} else { } else {
me.R1 = ["NONE", "TRANS ", "yel"]; me.R2 = ["NONE", "TRANS ", "yel"];
} }
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
@ -369,18 +381,8 @@ var arrivalPage = {
} }
if (size(me.stars) >= 1) { if (size(me.stars) >= 1) {
me.L2 = [" " ~ me.stars[0 + me.scrollStars], "STARS", "blu"]; me.L3 = [" " ~ me.stars[0 + me.scrollStars], "STARS", "blu"];
if (me.stars[0 + me.scrollStars] != me.selectedSTAR) { if (me.stars[0 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][1] = 1;
me.arrowsColour[0][1] = "blu";
} else {
me.arrowsMatrix[0][1] = 0;
me.arrowsColour[0][1] = "ack";
}
}
if (size(me.stars) >= 2) {
me.L3 = [" " ~ me.stars[1 + me.scrollStars], nil, "blu"];
if (me.stars[1 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][2] = 1; me.arrowsMatrix[0][2] = 1;
me.arrowsColour[0][2] = "blu"; me.arrowsColour[0][2] = "blu";
} else { } else {
@ -388,9 +390,9 @@ var arrivalPage = {
me.arrowsColour[0][2] = "ack"; me.arrowsColour[0][2] = "ack";
} }
} }
if (size(me.stars) >= 3) { if (size(me.stars) >= 2) {
me.L4 = [" " ~ me.stars[2 + me.scrollStars], nil, "blu"]; me.L4 = [" " ~ me.stars[1 + me.scrollStars], nil, "blu"];
if (me.stars[2 + me.scrollStars] != me.selectedSTAR) { if (me.stars[1 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][3] = 1; me.arrowsMatrix[0][3] = 1;
me.arrowsColour[0][3] = "blu"; me.arrowsColour[0][3] = "blu";
} else { } else {
@ -398,9 +400,9 @@ var arrivalPage = {
me.arrowsColour[0][3] = "ack"; me.arrowsColour[0][3] = "ack";
} }
} }
if (size(me.stars) >= 4) { if (size(me.stars) >= 3) {
me.L5 = [" " ~ me.stars[3 + me.scrollStars], nil, "blu"]; me.L5 = [" " ~ me.stars[2 + me.scrollStars], nil, "blu"];
if (me.stars[3 + me.scrollStars] != me.selectedSTAR) { if (me.stars[2 + me.scrollStars] != me.selectedSTAR) {
me.arrowsMatrix[0][4] = 1; me.arrowsMatrix[0][4] = 1;
me.arrowsColour[0][4] = "blu"; me.arrowsColour[0][4] = "blu";
} else { } else {
@ -409,27 +411,47 @@ var arrivalPage = {
} }
} }
me.C2 = [nil, "AVAILABLE", "wht"]; me.C3[1] = "AVAILABLE";
me.R2 = [nil, "TRANS ", "wht"]; me.R3[1] = "TRANS ";
if (size(me.stars) > 4) { if (size(me.stars) > 3) {
me.enableScrollStars = 1; me.enableScrollStars = 1;
} }
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0); canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}, },
updateActiveVIAs: func() { updateActiveVIAs: func() {
if (me.selectedVIA == "NO VIA") {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
me.C1 = ["NONE", "VIA", "grn"];
} else {
me.C1 = ["NONE", "VIA", "yel"];
}
} elsif (me.selectedVIA != nil) {
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].approach_trans.id, "VIA", "yel"];
} elsif (fmgc.flightPlanController.flightplans[2].approach_trans.id == me.selectedVIA.id) {
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "grn"];
} else {
me.C1 = ["-------", "VIA", "wht"];
}
} elsif (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].approach_trans.id, "VIA", "yel"];
} else {
me.C1 = ["-------", "VIA", "wht"];
}
} else {
me.C1 = ["-------", "VIA", "wht"];
}
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}, },
updateVIAs: func() { updateVIAs: func() {
#placeholder #placeholder
}, },
clearTransitions: func() { clearTransitions: func() {
me.R2 = [nil, "TRANS", "wht"]; me.R3 = [nil, nil, "wht"];
me.R3 = [nil, "TRANS", "wht"]; me.R4 = [nil, nil, "wht"];
me.R4 = [nil, "TRANS", "wht"]; me.R5 = [nil, nil, "wht"];
me.R5 = [nil, "TRANS", "wht"];
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
me.arrowsMatrix[1][2] = 0; me.arrowsMatrix[1][2] = 0;
me.arrowsColour[1][2] = "ack"; me.arrowsColour[1][2] = "ack";
me.arrowsMatrix[1][3] = 0; me.arrowsMatrix[1][3] = 0;
@ -442,62 +464,52 @@ var arrivalPage = {
me.arrAirport = findAirportsByICAO(left(me.id, 4)); me.arrAirport = findAirportsByICAO(left(me.id, 4));
} }
if (me.selectedSTAR == nil) { if (me.selectedSTAR == nil) {
me.R2 = ["NO TRANS ", "TRANS", "blu"]; me.R3 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) { if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
return;
}
if (me.selectedSTAR == "NO STAR") {
return;
}
me._transitions = me.arrAirport[0].getStar(me.selectedSTAR).transitions;
me.transitions = sort(me._transitions,func(a,b) cmp(a,b));
if (size(me.transitions) == 0) {
me.R2 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
} elsif (size(me.transitions) >= 1) {
me.R2 = [me.transitions[0] ~ " ", "TRANS", "blu"];
if (me.transitions[0] != me.selectedTransition) {
me.arrowsMatrix[1][1] = 1;
me.arrowsColour[1][1] = "blu";
} else {
me.arrowsMatrix[1][1] = 0;
me.arrowsColour[1][1] = "ack";
}
} elsif (size(me.transitions) >= 2) {
me.R3 = [me.transitions[1] ~ " ", nil, "blu"];
if (me.transitions[1] != me.selectedTransition) {
me.arrowsMatrix[1][2] = 1; me.arrowsMatrix[1][2] = 1;
me.arrowsColour[1][2] = "blu"; me.arrowsColour[1][2] = "blu";
} else { } else {
me.arrowsMatrix[1][2] = 0; me.arrowsMatrix[1][2] = 0;
me.arrowsColour[1][2] = "ack"; me.arrowsColour[1][2] = "ack";
} }
} elsif (size(me.transitions) >= 3) { return;
me.R4 = [me.transitions[2] ~ " ", nil, "blu"]; }
if (me.transitions[2] != me.selectedTransition) { if (me.selectedSTAR == "NO STAR") {
return;
}
me._transitions = me.arrAirport[0].getStar(me.selectedSTAR).transitions;
me.transitions = sort(me._transitions,func(a,b) cmp(a,b));
if (size(me.transitions) == 0) {
me.R3 = ["NO TRANS ", "TRANS", "blu"];
if (!me.hasPressNoTrans) {
me.arrowsMatrix[1][2] = 1;
me.arrowsColour[1][2] = "blu";
} else {
me.arrowsMatrix[1][2] = 0;
me.arrowsColour[1][2] = "ack";
}
} elsif (size(me.transitions) >= 1) {
me.R3 = [me.transitions[0] ~ " ", "TRANS", "blu"];
if (me.transitions[0] != me.selectedTransition) {
me.arrowsMatrix[1][2] = 1;
me.arrowsColour[1][2] = "blu";
} else {
me.arrowsMatrix[1][2] = 0;
me.arrowsColour[1][2] = "ack";
}
} elsif (size(me.transitions) >= 2) {
me.R4 = [me.transitions[1] ~ " ", nil, "blu"];
if (me.transitions[1] != me.selectedTransition) {
me.arrowsMatrix[1][3] = 1; me.arrowsMatrix[1][3] = 1;
me.arrowsColour[1][3] = "blu"; me.arrowsColour[1][3] = "blu";
} else { } else {
me.arrowsMatrix[1][3] = 0; me.arrowsMatrix[1][3] = 0;
me.arrowsColour[1][3] = "ack"; me.arrowsColour[1][3] = "ack";
} }
} elsif (size(me.transitions) >= 4) { } elsif (size(me.transitions) >= 3) {
me.R5 = [me.transitions[3] ~ " ", nil, "blu"]; me.R5 = [me.transitions[2] ~ " ", nil, "blu"];
if (me.transitions[3] != me.selectedTransition) { if (me.transitions[2] != me.selectedTransition) {
me.arrowsMatrix[1][4] = 1; me.arrowsMatrix[1][4] = 1;
me.arrowsColour[1][4] = "blu"; me.arrowsColour[1][4] = "blu";
} else { } else {
@ -505,6 +517,8 @@ var arrivalPage = {
me.arrowsColour[1][4] = "ack"; me.arrowsColour[1][4] = "ack";
} }
} }
# no indication it is scrollable...
}, },
makeTmpy: func() { makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) { if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
@ -518,6 +532,17 @@ var arrivalPage = {
} }
} }
}, },
checkPageType: func() {
if (me.activePage == 0) {
me.L2 = [nil, nil, "wht"];
me.arrowsMatrix[0][1] = 0;
me.arrowsColour[0][1] = "wht";
} else {
me.L2 = [" VIAS", " APPR", "wht"];
me.arrowsMatrix[0][1] = 1;
me.arrowsColour[0][1] = "wht";
}
},
scrollUp: func() { scrollUp: func() {
if (me.activePage == 0) { if (me.activePage == 0) {
if (me.enableScrollApproach) { if (me.enableScrollApproach) {
@ -587,16 +612,18 @@ var arrivalPage = {
scrollLeft: func() { scrollLeft: func() {
if (me.activePage == 2) { return; } if (me.activePage == 2) { return; }
me.activePage = !me.activePage; me.activePage = !me.activePage;
me.checkPageType();
me.updatePage(); me.updatePage();
}, },
scrollRight: func() { scrollRight: func() {
if (me.activePage == 2) { return; } if (me.activePage == 2) { return; }
me.activePage = !me.activePage; me.activePage = !me.activePage;
me.checkPageType();
me.updatePage(); me.updatePage();
}, },
arrPushbuttonLeft: func(index) { arrPushbuttonLeft: func(index) {
if (me.activePage == 0) { if (me.activePage == 0) {
if (size(me.approaches) >= (index - 2) and index != 2) { if (size(me.approaches) >= (index - 2) and index != 2) { # index = 3, size = 1
if (!dirToFlag) { if (!dirToFlag) {
me.selectedSTAR = nil; me.selectedSTAR = nil;
me.hasPressNoTrans = 0; me.hasPressNoTrans = 0;
@ -617,6 +644,7 @@ var arrivalPage = {
me.updateApproaches(); me.updateApproaches();
fmgc.flightPlanController.flightPlanChanged(me.computer); fmgc.flightPlanController.flightPlanChanged(me.computer);
me.scrollRight(); me.scrollRight();
me.checkPageType();
} else { } else {
mcdu_message(me.computer, "DIR TO IN PROGRESS"); mcdu_message(me.computer, "DIR TO IN PROGRESS");
} }
@ -624,9 +652,9 @@ var arrivalPage = {
mcdu_message(me.computer, "NOT ALLOWED"); mcdu_message(me.computer, "NOT ALLOWED");
} }
} elsif (me.activePage == 1) { } elsif (me.activePage == 1) {
if (size(me.stars) >= (index - 2)) { if (size(me.stars) >= (index - 2) and index != 2) {
if (!dirToFlag) { if (!dirToFlag) {
me.selectedSTAR = me.stars[index - 2 + me.scrollStars]; me.selectedSTAR = me.stars[index - 3 + me.scrollStars];
me.makeTmpy(); me.makeTmpy();
if (me.selectedSTAR != "NO STAR") { if (me.selectedSTAR != "NO STAR") {
isNoStar[me.computer] = 0; isNoStar[me.computer] = 0;
@ -655,7 +683,7 @@ var arrivalPage = {
mcdu_message(me.computer, "NOT ALLOWED"); mcdu_message(me.computer, "NOT ALLOWED");
} }
} else { } else {
if (size(me.vias) >= (index - 2)) { if (size(me.vias) >= (index - 1)) { # different!!
if (!dirToFlag) { if (!dirToFlag) {
my.selectedVIA = me.vias[index - 2 + me.scrollVias]; my.selectedVIA = me.vias[index - 2 + me.scrollVias];
me.makeTmpy(); me.makeTmpy();
@ -678,7 +706,7 @@ var arrivalPage = {
} }
}, },
arrPushbuttonRight: func(index) { arrPushbuttonRight: func(index) {
if (index == 2 and size(me.transitions) == 0) { if (index == 3 and size(me.transitions) == 0) {
if (!dirToFlag) { if (!dirToFlag) {
me.hasPressNoTrans = 1; me.hasPressNoTrans = 1;
me.updateActiveTransitions(); me.updateActiveTransitions();
@ -686,9 +714,9 @@ var arrivalPage = {
} else { } else {
mcdu_message(me.computer, "DIR TO IN PROGRESS"); mcdu_message(me.computer, "DIR TO IN PROGRESS");
} }
} elsif (size(me.transitions) >= (index - 1)) { } elsif (size(me.transitions) >= (index - 2)) {
if (!dirToFlag) { if (!dirToFlag) {
me.selectedTransition = me.transitions[index - 2]; me.selectedTransition = me.transitions[index - 3];
me.makeTmpy(); me.makeTmpy();
fmgc.flightPlanController.flightplans[me.computer].star_trans = me.selectedTransition; fmgc.flightPlanController.flightplans[me.computer].star_trans = me.selectedTransition;
me.updateActiveTransitions(); me.updateActiveTransitions();