Approach vias - add version check; restore functionality to top row
This commit is contained in:
parent
5be5724240
commit
96788e63cc
3 changed files with 35 additions and 29 deletions
|
@ -123,6 +123,12 @@ var flightPlanController = {
|
||||||
mcdu.isNoVia[2] = 0;
|
mcdu.isNoVia[2] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mcdu.isNoTrans[n] == 1) {
|
||||||
|
mcdu.isNoTrans[2] = 1;
|
||||||
|
} else {
|
||||||
|
mcdu.isNoTrans[2] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
me.flightPlanChanged(2);
|
me.flightPlanChanged(2);
|
||||||
flightPlanTimer.start();
|
flightPlanTimer.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,10 +72,13 @@ 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 (getprop("/sim/version/flightgear") == "2020.2.0") {
|
||||||
} elsif (isNoVia[2] == 1) {
|
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
|
||||||
me.selectedVIA = "NO VIA";
|
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
|
||||||
|
} elsif (isNoVia[2] == 1) {
|
||||||
|
me.selectedVIA = "NO VIA";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,15 +97,19 @@ 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) {
|
if (getprop("/sim/version/flightgear") == "2020.2.0") {
|
||||||
me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans;
|
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
|
||||||
} elsif (isNoVia[me.computer] == 1) {
|
me.selectedVIA = fmgc.flightPlanController.flightplans[me.computer].approach_trans;
|
||||||
me.selectedVIA = "NO VIA";
|
} elsif (isNoVia[me.computer] == 1) {
|
||||||
|
me.selectedVIA = "NO VIA";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} 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) {
|
if (getprop("/sim/version/flightgear") == "2020.2.0") {
|
||||||
me.selectedVIA = fmgc.flightPlanController.flightplans[2].approach_trans;
|
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) {
|
||||||
|
@ -188,7 +195,7 @@ var arrivalPage = {
|
||||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
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"];
|
||||||
} elsif (fmgc.flightPlanController.flightplans[2].destination_runway != nil) {
|
} elsif (fmgc.flightPlanController.flightplans[2].destination_runway != nil and fmgc.flightPlanController.flightplans[2].destination_runway.id == me.selectedApproach.id) {
|
||||||
me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "yel"];
|
me.L1 = [fmgc.flightPlanController.flightplans[2].destination_runway.id, " APPR", "yel"];
|
||||||
} else {
|
} else {
|
||||||
me.L1 = ["-----", " APPR", "wht"];
|
me.L1 = ["-----", " APPR", "wht"];
|
||||||
|
@ -204,13 +211,13 @@ var arrivalPage = {
|
||||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
|
if (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"];
|
||||||
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil and fmgc.flightPlanController.flightplans[2].approach == me.selectedApproach) {
|
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil and fmgc.flightPlanController.flightplans[2].approach.id == me.selectedApproach.id) {
|
||||||
me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "yel"];
|
me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "yel"];
|
||||||
} else {
|
} else {
|
||||||
me.L1 = ["-----", " APPR", "wht"];
|
me.L1 = ["-----", " APPR", "wht"];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fmgc.flightPlanController.flightplans[2].approach != nil and fmgc.flightPlanController.flightplans[2].approach == me.selectedApproach) {
|
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
|
||||||
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"];
|
||||||
|
@ -223,6 +230,8 @@ var arrivalPage = {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateActiveVIAs: func() {
|
updateActiveVIAs: func() {
|
||||||
|
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
|
||||||
|
|
||||||
if (me.selectedVIA == "NO VIA") {
|
if (me.selectedVIA == "NO VIA") {
|
||||||
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
me.C1 = ["NONE", "VIA", "grn"];
|
me.C1 = ["NONE", "VIA", "grn"];
|
||||||
|
@ -233,13 +242,13 @@ var arrivalPage = {
|
||||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
|
if (fmgc.flightPlanController.flightplans[me.computer].approach_trans != nil) {
|
||||||
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].approach_trans.id, "VIA", "yel"];
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].approach_trans.id, "VIA", "yel"];
|
||||||
} elsif (fmgc.flightPlanController.flightplans[2].approach_trans != nil and fmgc.flightPlanController.flightplans[2].approach_trans == me.selectedVIA) {
|
} elsif (fmgc.flightPlanController.flightplans[2].approach_trans != nil and fmgc.flightPlanController.flightplans[2].approach_trans.id == me.selectedVIA.id) {
|
||||||
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "yel"];
|
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "yel"];
|
||||||
} else {
|
} else {
|
||||||
me.C1 = ["-------", "VIA", "wht"];
|
me.C1 = ["-------", "VIA", "wht"];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil and fmgc.flightPlanController.flightplans[2].approach_trans == me.selectedVIA) {
|
if (fmgc.flightPlanController.flightplans[2].approach_trans != nil) {
|
||||||
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "grn"];
|
me.C1 = [fmgc.flightPlanController.flightplans[2].approach_trans.id, "VIA", "grn"];
|
||||||
} else {
|
} else {
|
||||||
me.C1 = ["-------", "VIA", "wht"];
|
me.C1 = ["-------", "VIA", "wht"];
|
||||||
|
@ -262,13 +271,13 @@ var arrivalPage = {
|
||||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
|
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
|
||||||
me.R1 = [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 != nil and fmgc.flightPlanController.flightplans[2].star == me.selectedSTAR) {
|
} elsif (fmgc.flightPlanController.flightplans[2].star != nil and fmgc.flightPlanController.flightplans[2].star.id == me.selectedSTAR.id) {
|
||||||
me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "yel"];
|
me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "yel"];
|
||||||
} else {
|
} else {
|
||||||
me.R1 = ["-------", "STAR ", "wht"];
|
me.R1 = ["-------", "STAR ", "wht"];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fmgc.flightPlanController.flightplans[2].star != nil and fmgc.flightPlanController.flightplans[2].star == me.selectedSTAR) {
|
if (fmgc.flightPlanController.flightplans[2].star != nil) {
|
||||||
me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "grn"];
|
me.R1 = [fmgc.flightPlanController.flightplans[2].star.id, "STAR ", "grn"];
|
||||||
} else {
|
} else {
|
||||||
me.R1 = ["-------", "STAR ", "wht"];
|
me.R1 = ["-------", "STAR ", "wht"];
|
||||||
|
@ -292,7 +301,7 @@ var arrivalPage = {
|
||||||
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
if (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
|
if (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
|
||||||
me.R2 = [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 != nil and fmgc.flightPlanController.flightplans[2].star_trans == me.selectedTransition) {
|
} elsif (fmgc.flightPlanController.flightplans[2].star_trans != nil and fmgc.flightPlanController.flightplans[2].star_trans.id == me.selectedTransition.id) {
|
||||||
me.R2 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS ", "yel"];
|
me.R2 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS ", "yel"];
|
||||||
} else {
|
} else {
|
||||||
me.R2 = ["-------", "TRANS ", "wht"];
|
me.R2 = ["-------", "TRANS ", "wht"];
|
||||||
|
@ -484,6 +493,7 @@ var arrivalPage = {
|
||||||
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
},
|
},
|
||||||
updateVIAs: func() {
|
updateVIAs: func() {
|
||||||
|
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
|
||||||
if (me.selectedApproach == nil or me.activePage != 2) {
|
if (me.selectedApproach == nil or me.activePage != 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -712,6 +722,7 @@ var arrivalPage = {
|
||||||
},
|
},
|
||||||
arrPushbuttonLeft: func(index) {
|
arrPushbuttonLeft: func(index) {
|
||||||
if (index == 2 and me.activePage == 1 and me.selectedApproach != nil) {
|
if (index == 2 and me.activePage == 1 and me.selectedApproach != nil) {
|
||||||
|
if (getprop("/sim/version/flightgear") != "2020.2.0") { return; }
|
||||||
me.oldPage = me.activePage;
|
me.oldPage = me.activePage;
|
||||||
me.activePage = 2;
|
me.activePage = 2;
|
||||||
me.updatePage();
|
me.updatePage();
|
||||||
|
|
|
@ -216,17 +216,6 @@ var fplnPage = { # this one is only created once, and then updated - remember th
|
||||||
R5: [nil, nil, "ack"],
|
R5: [nil, nil, "ack"],
|
||||||
R6: [nil, nil, "ack"],
|
R6: [nil, nil, "ack"],
|
||||||
|
|
||||||
# init conditions
|
|
||||||
# line 1 = FROM
|
|
||||||
# line 2 = TO
|
|
||||||
# line 6 = DEST
|
|
||||||
# neither pseudo nor markers may be FROM waypoint
|
|
||||||
# bearing between FROM and TO waypoints
|
|
||||||
# track between line 2 and line 3 waypoints
|
|
||||||
# name of LEG above TO waypoint - is airway identifier, or waypoint name
|
|
||||||
|
|
||||||
# DEST in LINE 6 time prediction, distance along flightplan, and EFOB
|
|
||||||
# dashes if no predictions
|
|
||||||
planList: [],
|
planList: [],
|
||||||
outputList: [],
|
outputList: [],
|
||||||
scroll: 0,
|
scroll: 0,
|
||||||
|
|
Loading…
Reference in a new issue