1
0
Fork 0

Minor changes to VERTREV page, enable VERTREV on departure airport, STEP CLB only available in climb phases with cruise flightlevel inserted

This commit is contained in:
legoboyvdlp R 2020-04-23 14:01:13 +01:00
parent 7899e4e7e1
commit 2bbce850d4
2 changed files with 65 additions and 24 deletions

View file

@ -123,8 +123,7 @@ var fplnItem = {
if (me.index == fmgc.flightPlanController.arrivalIndex[me.computer]) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
} if (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
notAllowed(me.computer);
return;
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer);
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer);
} else {
@ -134,8 +133,7 @@ var fplnItem = {
if (me.index == fmgc.flightPlanController.arrivalIndex[2]) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[2].departure.id) {
notAllowed(me.computer);
return;
canvas_mcdu.myVertRev[me.computer] = vertRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer);
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer);
} else {

View file

@ -45,35 +45,49 @@ var vertRev = {
me.title = ["VERT REV", " AT ", "PPOS"];
me.L1 = ["", " EFOB ---.-", "wht"];
me.R1 = ["", "EXTRA ---.- ", "wht"];
me.L2 = [" 250/10000", " CLB SPD LIM", "mag"];
me.L2 = ["250/10000", " CLB SPD LIM", "mag"];
me.L4 = [" CONSTANT MACH", nil, "wht"];
me.L5 = [" WIND DATA", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R5 = ["STEP ALTS ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "ack", "ack", "ack", "wht", "wht"]];
me.R2 = ["RTA ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
} if (me.type == 2) {
me.title = ["VERT REV", " AT ", me.id];
me.L1 = ["", " EFOB ---.-", "wht"];
me.R1 = ["", "EXTRA ---.- ", "wht"];
me.L2 = [" 250/10000", " CLB SPD LIM", "mag"];
me.L2 = ["250/10000", " CLB SPD LIM", "mag"];
me.L3 = [" [ ]", " SPD CSTR", "blu"];
me.L4 = [" CONSTANT MACH", nil, "wht"];
me.L5 = [" WIND DATA", nil, "wht"];
me.L6 = [" CLB", nil, "wht"];
me.R2 = ["[ ] ", "UTC CSTR ", "blu"];
me.R2 = ["RTA ", nil, "wht"];
me.R3 = ["[ ] ", "ALT CSTR ", "blu"];
me.R5 = ["STEP ALTS ", nil, "wht"];
me.R6 = ["DES ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "ack", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0]];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0]];
} else {
me.title = ["VERT REV", " AT ", me.id];
if (me.type == 0) {
# dunno
if (size(me.id) > 4) {
me.arrAirport = findAirportsByICAO(left(me.id, 4));
} else {
me.arrAirport = findAirportsByICAO(me.id);
}
me.L1 = ["", " EFOB ---.-", "wht"];
me.R1 = ["", "EXTRA ---.- ", "wht"];
me.L2 = ["250/10000", " CLB SPD LIM", "mag"];
me.L4 = [" CONSTANT MACH", nil, "wht"];
me.L5 = [" WIND DATA", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R2 = ["RTA ", nil, "wht"];
me.R6 = ["DES ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
} elsif (me.type == 1) {
if (size(me.id) > 4) {
me.arrAirport = findAirportsByICAO(left(me.id, 4));
@ -82,19 +96,19 @@ var vertRev = {
}
me.L1 = ["", " EFOB ---.-", "wht"];
me.R1 = ["", "EXTRA ---.- ", "wht"];
me.L2 = [" 250/10000", " DES SPD LIM", "mag"];
me.L2 = ["250/10000", " DES SPD LIM", "mag"];
me.L4 = [" CONSTANT MACH", nil, "wht"];
me.L5 = [" WIND DATA", nil, "wht"];
me.L6 = [" CLB", nil, "wht"];
me.R2 = ["[ ] ", "UTC CSTR ", "blu"];
me.R3 = ["[ ]", "G/S INTCPT ", "grn"];
me.R5 = ["STEP ALTS ", nil, "wht"];
me.L6 = [" RETURN", nil, "wht"];
me.R2 = ["RTA ", nil, "wht"];
me.R3 = ["3000", "G/S INTCP", "grn"];
me.R6 = ["DES ", nil, "wht"];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "ack", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0]];
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "wht", "ack", "ack", "wht", "wht"]];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
}
}
me.updateR5();
},
makeTmpy: func() {
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
@ -107,4 +121,33 @@ var vertRev = {
me._checkTmpy();
}
},
};
updateR5: func() {
if (getprop("FMGC/internal/cruise-lvl-set") and (getprop("FMGC/status/phase") < 4 or getprop("FMGC/status/phase") == 7)) {
me.R5 = ["STEP ALTS ", nil, "wht"];
me.arrows[1][4] = 1;
} else {
me.R5 = [nil, nil, "ack"];
me.arrows[1][4] = 0;
}
},
};
setlistener("FMGC/internal/cruise-lvl-set", func() {
if (canvas_mcdu.myVertRev[0] != nil) {
canvas_mcdu.myVertRev[0].updateR5();
}
if (canvas_mcdu.myVertRev[1] != nil) {
canvas_mcdu.myVertRev[1].updateR5();
}
}, 0, 0);
setlistener("FMGC/status/phase", func() {
if (canvas_mcdu.myVertRev[0] != nil) {
canvas_mcdu.myVertRev[0].updateR5();
}
if (canvas_mcdu.myVertRev[1] != nil) {
canvas_mcdu.myVertRev[1].updateR5();
}
}, 0, 0);