Proper airport btn
This commit is contained in:
parent
7a92a773c2
commit
26af612b7e
2 changed files with 23 additions and 11 deletions
|
@ -137,6 +137,8 @@ var holdPage = {
|
|||
} else {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
},
|
||||
pushbuttonRight: func(index) {
|
||||
|
@ -150,6 +152,8 @@ var holdPage = {
|
|||
} else {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
} else {
|
||||
mcdu_message(me.computer, "NOT ALLOWED");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
var pageNode = [props.globals.getNode("/MCDU[0]/page"), props.globals.getNode("/MCDU[1]/page")];
|
||||
var page = nil;
|
||||
var msg = nil;
|
||||
var airportPress = [0,0];
|
||||
|
||||
var scratchpadNode = [nil, nil];
|
||||
var MCDU_init = func(i) {
|
||||
|
@ -1460,25 +1461,32 @@ var pagebutton = func(btn, i) {
|
|||
#}
|
||||
mcdu_message(i, "SELECT DESIRED SYSTEM");
|
||||
pageNode[i].setValue("MCDU");
|
||||
} else if (btn == "f-pln" or btn == "airport") {
|
||||
} else if (btn == "f-pln") {
|
||||
if (canvas_mcdu.myFpln[i] == nil) {
|
||||
canvas_mcdu.myFpln[i] = fplnPage.new(2, i);
|
||||
}
|
||||
if (btn == "airport") {
|
||||
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
|
||||
canvas_mcdu.myFpln[i].scroll = 0;
|
||||
} else {
|
||||
if (fmgc.flightPlanController.temporaryFlag[i]) {
|
||||
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[i];
|
||||
canvas_mcdu.myFpln[i].scroll = 0;
|
||||
pageNode[i].setValue("F-PLNA");
|
||||
} else if (btn == "airport") {
|
||||
if (airportPress[i] == 0 or fmgc.FMGCInternal.phase >= 1) {
|
||||
if (fmgc.flightPlanController.temporaryFlag[i]) {
|
||||
if (fmgc.flightPlanController.currentToWptIndex.getValue() == fmgc.flightPlanController.arrivalIndex[i]) {
|
||||
canvas_mcdu.myFpln[i].scroll = (fmgc.flightPlanController.arrivalIndex[i] - fmgc.flightPlanController.currentToWptIndex.getValue());
|
||||
} else {
|
||||
canvas_mcdu.myFpln[i].scroll = fmgc.flightPlanController.arrivalIndex[2];
|
||||
canvas_mcdu.myFpln[i].scroll = (fmgc.flightPlanController.arrivalIndex[i] - fmgc.flightPlanController.currentToWptIndex.getValue()) - 1;
|
||||
}
|
||||
} else {
|
||||
if (fmgc.flightPlanController.currentToWptIndex.getValue() == fmgc.flightPlanController.arrivalIndex[2]) {
|
||||
canvas_mcdu.myFpln[i].scroll = (fmgc.flightPlanController.arrivalIndex[2] - fmgc.flightPlanController.currentToWptIndex.getValue());
|
||||
} else {
|
||||
canvas_mcdu.myFpln[i].scroll = (fmgc.flightPlanController.arrivalIndex[2] - fmgc.flightPlanController.currentToWptIndex.getValue()) - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
airportPress[i] = 1;
|
||||
} else if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
|
||||
canvas_mcdu.myFpln[i].scroll = 0;
|
||||
airportPress[i] = 0;
|
||||
}
|
||||
pageNode[i].setValue("F-PLNA");
|
||||
|
||||
} else if (btn == "fuel-pred") {
|
||||
pageNode[i].setValue("FUELPRED");
|
||||
} else if (btn == "dirto") {
|
||||
|
|
Loading…
Reference in a new issue