2020-04-08 21:49:27 +00:00
|
|
|
var holdPage = {
|
|
|
|
title: [nil, nil, nil],
|
|
|
|
subtitle: [nil, nil],
|
|
|
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
|
|
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
|
|
|
L1: [nil, nil, "ack"], # content, title, colour
|
|
|
|
L2: [nil, nil, "ack"],
|
|
|
|
L3: [nil, nil, "ack"],
|
|
|
|
L4: [nil, nil, "ack"],
|
|
|
|
L5: [nil, nil, "ack"],
|
|
|
|
L6: [nil, nil, "ack"],
|
|
|
|
C1: [nil, nil, "ack"],
|
|
|
|
C2: [nil, nil, "ack"],
|
|
|
|
C3: [nil, nil, "ack"],
|
|
|
|
C4: [nil, nil, "ack"],
|
|
|
|
C5: [nil, nil, "ack"],
|
|
|
|
C6: [nil, nil, "ack"],
|
|
|
|
R1: [nil, nil, "ack"],
|
|
|
|
R2: [nil, nil, "ack"],
|
|
|
|
R3: [nil, nil, "ack"],
|
|
|
|
R4: [nil, nil, "ack"],
|
|
|
|
R5: [nil, nil, "ack"],
|
|
|
|
R6: [nil, nil, "ack"],
|
|
|
|
scroll: 0,
|
|
|
|
vector: [],
|
|
|
|
index: nil,
|
|
|
|
computer: nil,
|
|
|
|
new: func(computer, waypoint) {
|
|
|
|
var hp = {parents:[holdPage]};
|
|
|
|
hp.computer = computer;
|
|
|
|
hp.waypoint = waypoint;
|
|
|
|
hp._setupPageWithData();
|
2020-05-04 10:48:22 +00:00
|
|
|
hp.updateTmpy();
|
2020-04-08 21:49:27 +00:00
|
|
|
return hp;
|
|
|
|
},
|
|
|
|
del: func() {
|
|
|
|
return nil;
|
|
|
|
},
|
|
|
|
_setupPageWithData: func() {
|
2020-04-24 11:54:42 +00:00
|
|
|
me.title = ["HOLD", " AT ", me.waypoint.wp_name];
|
2020-04-08 21:49:27 +00:00
|
|
|
me.titleColour = "wht";
|
2020-06-14 13:42:58 +00:00
|
|
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0]];
|
2022-01-14 13:07:51 +00:00
|
|
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["blu", "blu", "ack", "ack", "ack", "ack"]];
|
2020-06-14 13:42:58 +00:00
|
|
|
if (me.waypoint.fly_type == "Hold") {
|
|
|
|
me.makeTmpy();
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L1 = [sprintf("%03.0f°", me.waypoint.hold_inbound_radial), "INB CRS", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
|
|
|
|
if (me.waypoint.hold_is_left_handed) {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L2 = ["L", " TURN", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
} else {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L2 = ["R", " TURN", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (me.waypoint.hold_is_distance) {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L3 = [" -.-/" ~ me.waypoint.hold_time_or_distance, "TIME/DIST", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
} else {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L3 = [sprintf("%3.1f", (me.waypoint.hold_time_or_distance / 60)) ~ "/----", "TIME/DIST", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
}
|
2022-01-14 13:07:51 +00:00
|
|
|
me.R1 = ["COMPUTED ", nil, "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
me.R2 = ["DATABASE ", nil, "yel"];
|
|
|
|
me.arrowsMatrix[1][1] = 0;
|
2020-04-08 21:49:27 +00:00
|
|
|
} else {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L1 = ["100°", "INB CRS", "blu"];
|
|
|
|
me.L2 = ["R", " TURN", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
if (pts.Instrumentation.Altimeter.indicatedFt.getValue() >= 14000) {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L3 = ["1.5/----", "TIME/DIST", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
} else {
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L3 = ["1.0/----", "TIME/DIST", "blu"];
|
2020-06-14 13:42:58 +00:00
|
|
|
}
|
2022-01-14 13:07:51 +00:00
|
|
|
me.R1 = ["COMPUTED ", nil, "blu"];
|
|
|
|
me.R2 = ["DATABASE ", nil, "blu"];
|
2020-04-08 21:49:27 +00:00
|
|
|
}
|
|
|
|
me.L6 = [" RETURN", nil, "wht"];
|
|
|
|
me.C4 = ["LAST EXIT", nil, "wht"];
|
|
|
|
me.C5 = ["---- ---.-", "UTC FUEL", "wht"];
|
|
|
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
|
|
|
},
|
|
|
|
makeTmpy: func() {
|
|
|
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
|
|
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
updateTmpy: func() {
|
|
|
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
2020-05-04 10:48:22 +00:00
|
|
|
me.L1[2] = "yel";
|
|
|
|
me.L2[2] = "yel";
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L3[2] = "yel";
|
2020-04-08 21:49:27 +00:00
|
|
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
2020-06-14 13:42:58 +00:00
|
|
|
me.R6 = ["INSERT ", " TMPY", "yel"];
|
2020-04-08 21:49:27 +00:00
|
|
|
me.arrowsColour[0][5] = "yel";
|
2020-05-04 10:48:22 +00:00
|
|
|
me.titleColour = "yel";
|
|
|
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
|
|
|
} else {
|
|
|
|
me.L1[2] = "blu";
|
|
|
|
me.L2[2] = "blu";
|
2022-01-14 13:07:51 +00:00
|
|
|
me.L3[2] = "blu";
|
2020-05-04 10:48:22 +00:00
|
|
|
me.L6 = [" RETURN", nil, "wht"];
|
|
|
|
me.R6 = [nil, nil, "ack"];
|
|
|
|
me.arrowsColour[0][5] = "wht";
|
|
|
|
me.titleColour = "wht";
|
2020-04-08 21:49:27 +00:00
|
|
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|