diff --git a/A320-main.xml b/A320-main.xml
index 66d0578f..374652f3 100644
--- a/A320-main.xml
+++ b/A320-main.xml
@@ -1911,6 +1911,7 @@
Aircraft/A320-family/Nasal/FMGC/FMGC-c.nas
+ Aircraft/A320-family/Nasal/MCDU/DIRTO.nas
Aircraft/A320-family/Nasal/MCDU/LATREV.nas
Aircraft/A320-family/Nasal/MCDU/VERTREV.nas
Aircraft/A320-family/Nasal/MCDU/DEPARTURE.nas
diff --git a/Models/Instruments/MCDU/MCDU.nas b/Models/Instruments/MCDU/MCDU.nas
index d7ddcaab..e02f5bc8 100644
--- a/Models/Instruments/MCDU/MCDU.nas
+++ b/Models/Instruments/MCDU/MCDU.nas
@@ -11,6 +11,7 @@ var myVertRev = [nil, nil];
var myDeparture = [nil, nil];
var myArrival = [nil, nil];
var myFpln = [nil, nil];
+var myDirTo = [nil, nil];
var myDuplicate = [nil, nil];
var default = "BoeingCDU-Large.ttf";
var symbol = "helvetica_medium.txf";
@@ -3596,6 +3597,243 @@ var canvas_MCDU_base = {
}
pageSwitch[i].setBoolValue(1);
}
+ } elsif (page == "DIRTO") {
+ if (!pageSwitch[i].getBoolValue()) {
+ me["Simple"].show();
+ me["Simple_Center"].hide();
+ me["FPLN"].hide();
+ me["INITA"].hide();
+ me["INITB"].hide();
+ me["PERFTO"].hide();
+ me["arrowsDepArr"].hide();
+ me["Simple_PageNum"].setText("X/X");
+ me["Simple_PageNum"].hide();
+ me["Simple_Title"].show();
+ me["ArrowLeft"].hide();
+ me["ArrowRight"].hide();
+
+ me.fontLeft(default, default, default, default, default, default);
+ me.fontLeftS(default, default, default, default, default, default);
+ me.fontRight(default, default, default, default, default, default);
+ me.fontRightS(default, default, default, default, default, default);
+
+ me.fontSizeLeft(normal, normal, normal, normal, normal, normal);
+ me.fontSizeRight(normal, normal, normal, normal, normal, normal);
+
+ me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
+ me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
+ me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
+ me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
+
+ if (myDirTo[i] != nil) {
+ me["Simple_Title"].setText(sprintf("%s", myDirTo[i].title));
+
+ forindex (var matrixArrow; myDirTo[i].arrowsMatrix) {
+ if (matrixArrow == 0) {
+ var sign = "L";
+ } else {
+ var sign = "R";
+ }
+ forindex (var item; myDirTo[i].arrowsMatrix[matrixArrow]) {
+ if (myDirTo[i].arrowsMatrix[matrixArrow][item] == 1) {
+ me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].show();
+ } else {
+ me["Simple_" ~ sign ~ (item + 1) ~ "_Arrow"].hide();
+ }
+ }
+ }
+ me.colorLeftArrow(myDirTo[i].arrowsColour[0][0],myDirTo[i].arrowsColour[0][1],myDirTo[i].arrowsColour[0][2],myDirTo[i].arrowsColour[0][3],myDirTo[i].arrowsColour[0][4],myDirTo[i].arrowsColour[0][5]);
+
+
+ forindex (var matrixFont; myDirTo[i].fontMatrix) {
+ if (matrixFont == 0) {
+ var sign = "L";
+ } else {
+ var sign = "R";
+ }
+ forindex (var item; myDirTo[i].fontMatrix[matrixFont]) {
+ if (myDirTo[i].fontMatrix[matrixFont][item] == 1) {
+ me["Simple_" ~ sign ~ (item + 1)].setFont(symbol);
+ me["Simple_" ~ sign ~ (item + 1)].setFontSize(small);
+ } else {
+ me["Simple_" ~ sign ~ (item + 1)].setFont(default);
+ me["Simple_" ~ sign ~ (item + 1)].setFontSize(normal);
+ }
+ }
+ }
+
+ if (myDirTo[i].L1[0] == nil) {
+ me["Simple_L1"].hide();
+ me["Simple_L1S"].hide();
+ } else {
+ me["Simple_L1"].show();
+ me["Simple_L1"].setText(myDirTo[i].L1[0]);
+ if (myDirTo[i].L1[1] != nil) {
+ me["Simple_L1S"].show();
+ me["Simple_L1S"].setText(myDirTo[i].L1[1]);
+ } else {
+ me["Simple_L1S"].hide();
+ }
+ }
+
+ if (myDirTo[i].L2[0] == nil) {
+ me["Simple_L2"].hide();
+ me["Simple_L2S"].hide();
+ } else {
+ me["Simple_L2"].show();
+ me["Simple_L2"].setText(myDirTo[i].L2[0]);
+ if (myDirTo[i].L2[1] != nil) {
+ me["Simple_L2S"].show();
+ me["Simple_L2S"].setText(myDirTo[i].L2[1]);
+ } else {
+ me["Simple_L2S"].hide();
+ }
+ }
+
+ if (myDirTo[i].L3[0] == nil) {
+ me["Simple_L3"].hide();
+ me["Simple_L3S"].hide();
+ } else {
+ me["Simple_L3"].show();
+ me["Simple_L3"].setText(myDirTo[i].L3[0]);
+ if (myDirTo[i].L3[1] != nil) {
+ me["Simple_L3S"].show();
+ me["Simple_L3S"].setText(myDirTo[i].L3[1]);
+ } else {
+ me["Simple_L3S"].hide();
+ }
+ }
+
+ if (myDirTo[i].L4[0] == nil) {
+ me["Simple_L4"].hide();
+ me["Simple_L4S"].hide();
+ } else {
+ me["Simple_L4"].show();
+ me["Simple_L4"].setText(myDirTo[i].L4[0]);
+ if (myDirTo[i].L4[1] != nil) {
+ me["Simple_L4S"].show();
+ me["Simple_L4S"].setText(myDirTo[i].L4[1]);
+ } else {
+ me["Simple_L4S"].hide();
+ }
+ }
+
+ if (myDirTo[i].L5[0] == nil) {
+ me["Simple_L5"].hide();
+ me["Simple_L5S"].hide();
+ } else {
+ me["Simple_L5"].show();
+ me["Simple_L5"].setText(myDirTo[i].L5[0]);
+ if (myDirTo[i].L5[1] != nil) {
+ me["Simple_L5S"].show();
+ me["Simple_L5S"].setText(myDirTo[i].L5[1]);
+ } else {
+ me["Simple_L5S"].hide();
+ }
+ }
+
+ if (myDirTo[i].L6[0] == nil) {
+ me["Simple_L6"].hide();
+ me["Simple_L6S"].hide();
+ } else {
+ me["Simple_L6"].show();
+ me["Simple_L6"].setText(myDirTo[i].L6[0]);
+ if (myDirTo[i].L6[1] != nil) {
+ me["Simple_L6S"].show();
+ me["Simple_L6S"].setText(myDirTo[i].L6[1]);
+ } else {
+ me["Simple_L6S"].hide();
+ }
+ }
+ me.colorLeft(myDirTo[i].L1[2],myDirTo[i].L2[2],myDirTo[i].L3[2],myDirTo[i].L4[2],myDirTo[i].L5[2],myDirTo[i].L6[2]);
+
+ if (myDirTo[i].R1[0] == nil) {
+ me["Simple_R1"].hide();
+ me["Simple_R1S"].hide();
+ } else {
+ me["Simple_R1"].show();
+ me["Simple_R1"].setText(myDirTo[i].R1[0]);
+ if (myDirTo[i].R1[1] != nil) {
+ me["Simple_R1S"].show();
+ me["Simple_R1S"].setText(myDirTo[i].R1[1]);
+ } else {
+ me["Simple_R1S"].hide();
+ }
+ }
+
+ if (myDirTo[i].R2[0] == nil) {
+ me["Simple_R2"].hide();
+ me["Simple_R2S"].hide();
+ } else {
+ me["Simple_R2"].show();
+ me["Simple_R2"].setText(myDirTo[i].R2[0]);
+ if (myDirTo[i].R2[1] != nil) {
+ me["Simple_R2S"].show();
+ me["Simple_R2S"].setText(myDirTo[i].R2[1]);
+ } else {
+ me["Simple_R2S"].hide();
+ }
+ }
+
+ if (myDirTo[i].R3[0] == nil) {
+ me["Simple_R3"].hide();
+ me["Simple_R3S"].hide();
+ } else {
+ me["Simple_R3"].show();
+ me["Simple_R3"].setText(myDirTo[i].R3[0]);
+ if (myDirTo[i].R3[1] != nil) {
+ me["Simple_R3S"].show();
+ me["Simple_R3S"].setText(myDirTo[i].R3[1]);
+ } else {
+ me["Simple_R3S"].hide();
+ }
+ }
+
+ if (myDirTo[i].R4[0] == nil) {
+ me["Simple_R4"].hide();
+ me["Simple_R4S"].hide();
+ } else {
+ me["Simple_R4"].show();
+ me["Simple_R4"].setText(myDirTo[i].R4[0]);
+ if (myDirTo[i].R4[1] != nil) {
+ me["Simple_R4S"].show();
+ me["Simple_R4S"].setText(myDirTo[i].R4[1]);
+ } else {
+ me["Simple_R4S"].hide();
+ }
+ }
+
+ if (myDirTo[i].R5[0] == nil) {
+ me["Simple_R5"].hide();
+ me["Simple_R5S"].hide();
+ } else {
+ me["Simple_R5"].show();
+ me["Simple_R5"].setText(myDirTo[i].R5[0]);
+ if (myDirTo[i].R5[1] != nil) {
+ me["Simple_R5S"].show();
+ me["Simple_R5S"].setText(myDirTo[i].R5[1]);
+ } else {
+ me["Simple_R5S"].hide();
+ }
+ }
+
+ if (myDirTo[i].R6[0] == nil) {
+ me["Simple_R6"].hide();
+ me["Simple_R6S"].hide();
+ } else {
+ me["Simple_R6"].show();
+ me["Simple_R6"].setText(myDirTo[i].R6[0]);
+ if (myDirTo[i].R6[1] != nil) {
+ me["Simple_R6S"].show();
+ me["Simple_R6S"].setText(myDirTo[i].R6[1]);
+ } else {
+ me["Simple_R6S"].hide();
+ }
+ }
+ me.colorRight(myDirTo[i].R1[2],myDirTo[i].R2[2],myDirTo[i].R3[2],myDirTo[i].R4[2],myDirTo[i].R5[2],myDirTo[i].R6[2]);
+ }
+ pageSwitch[i].setBoolValue(1);
+ }
} else {
if (!pageSwitch[i].getBoolValue()) {
me["Simple"].hide();
diff --git a/Models/Instruments/MCDU/MCDU1.xml b/Models/Instruments/MCDU/MCDU1.xml
index 541b08a2..518cf4d9 100644
--- a/Models/Instruments/MCDU/MCDU1.xml
+++ b/Models/Instruments/MCDU/MCDU1.xml
@@ -251,6 +251,31 @@
+
+ pick
+ dir
+
+
+ false
+
+ nasal
+
+
+
+
+ systems/electrical/bus/ac-1
+ 110
+
+
+ controls/lighting/DU/mcdu1
+ 0.01
+
+
+
+
+
+
+
pick
L1
diff --git a/Models/Instruments/MCDU/MCDU2.xml b/Models/Instruments/MCDU/MCDU2.xml
index adf05c55..015c4def 100644
--- a/Models/Instruments/MCDU/MCDU2.xml
+++ b/Models/Instruments/MCDU/MCDU2.xml
@@ -251,6 +251,31 @@
+
+ pick
+ dir
+
+
+ false
+
+ nasal
+
+
+
+
+ systems/electrical/bus/ac-2
+ 110
+
+
+ controls/lighting/DU/mcdu2
+ 0.01
+
+
+
+
+
+
+
pick
L1
diff --git a/Nasal/MCDU/DIRTO.nas b/Nasal/MCDU/DIRTO.nas
new file mode 100644
index 00000000..825a314a
--- /dev/null
+++ b/Nasal/MCDU/DIRTO.nas
@@ -0,0 +1,50 @@
+var dirTo = {
+ title: [nil],
+ subtitle: [nil, nil],
+ fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
+ 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"],
+ R1: [nil, nil, "ack"],
+ R2: [nil, nil, "ack"],
+ R3: [nil, nil, "ack"],
+ R4: [nil, nil, "ack"],
+ R5: [nil, nil, "ack"],
+ R6: [nil, nil, "ack"],
+ index: nil,
+ computer: nil,
+ new: func(computer) {
+ var dt = {parents:[dirTo]};
+ dt.computer = computer;
+ dt._setupPageWithData();
+ return dt;
+ },
+ del: func() {
+ return nil;
+ },
+ _setupPageWithData: func() {
+ me.title = ["DIR TO"];
+ me.L1 = [" [ ]", " WAYPOINT", "blu"];
+ me.L2 = [nil, " F-PLN WPTS", "blu"];
+ me.L6 = [" ERASE", " DIR TO", "yel"];
+ me.R1 = ["---- --- ", "UTC DIST ", "wht"];
+ me.R2 = ["DIRECT TO ", nil, "blu"];
+ me.R3 = ["ABEAM PTS ", "WITH ", "blu"];
+ me.R4 = ["[ ] ", "RADIAL IN ", "blu"];
+ me.R5 = ["[ ] ", "RADIAL OUT ", "blu"];
+ me.arrowsMatrix = [[0, 1, 1, 1, 1, 1], [0, 1, 0, 1, 0, 0]];
+ me.arrowsColour = [["ack", "blu", "blu", "blu", "blu", "yel"], ["ack", "blu", "ack", "blu", "ack", "ack"]];
+ me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
+ canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
+ },
+ makeTmpy: func() {
+ if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
+ fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
+ }
+ },
+};
\ No newline at end of file
diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas
index 011ed6b4..e1fc3831 100644
--- a/Nasal/MCDU/MCDU.nas
+++ b/Nasal/MCDU/MCDU.nas
@@ -525,6 +525,11 @@ var pagebutton = func(btn, i) {
}
} else if (btn == "fuel-pred") {
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
+ } else if (btn == "dirto") {
+ if (canvas_mcdu.myDirTo[i] == nil) {
+ canvas_mcdu.myDirTo[i] = dirTo.new(i);
+ }
+ setprop("MCDU[" ~ i ~ "]/page", "DIRTO");
}
}
}
diff --git a/gui/dialogs/mcdu1-dlg.xml b/gui/dialogs/mcdu1-dlg.xml
index 545235b3..82a9cfc3 100644
--- a/gui/dialogs/mcdu1-dlg.xml
+++ b/gui/dialogs/mcdu1-dlg.xml
@@ -292,6 +292,16 @@
25
40
+
+ nasal
+
+
+
+ systems/electrical/bus/ac-1
+ 110
+
+
+