1
0
Fork 0

dummy DIRTO page

This commit is contained in:
legoboyvdlp R 2020-03-26 20:40:49 +00:00
parent 42d733745f
commit fa5eaa2a7a
8 changed files with 364 additions and 0 deletions

View file

@ -1911,6 +1911,7 @@
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-c.nas</file>
</fmgc>
<mcdu>
<file>Aircraft/A320-family/Nasal/MCDU/DIRTO.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/LATREV.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/VERTREV.nas</file> <!-- dynamic page - init before MCDU -->
<file>Aircraft/A320-family/Nasal/MCDU/DEPARTURE.nas</file> <!-- dynamic page - init before MCDU -->

View file

@ -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();

View file

@ -251,6 +251,31 @@
</action>
</animation>
<animation>
<type>pick</type>
<object-name>dir</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>mcdu.pagebutton("dirto", 0);</script>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/ac-1</property>
<value>110</value>
</greater-than-equals>
<greater-than>
<property>controls/lighting/DU/mcdu1</property>
<value>0.01</value>
</greater-than>
</and>
</condition>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>L1</object-name>

View file

@ -251,6 +251,31 @@
</action>
</animation>
<animation>
<type>pick</type>
<object-name>dir</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>mcdu.pagebutton("dirto", 1);</script>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/ac-2</property>
<value>110</value>
</greater-than-equals>
<greater-than>
<property>controls/lighting/DU/mcdu2</property>
<value>0.01</value>
</greater-than>
</and>
</condition>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>L1</object-name>

50
Nasal/MCDU/DIRTO.nas Normal file
View file

@ -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);
}
},
};

View file

@ -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");
}
}
}

View file

@ -292,6 +292,16 @@
<legend>DIR</legend>
<pref-height>25</pref-height>
<pref-width>40</pref-width>
<binding>
<command>nasal</command>
<script>mcdu.pagebutton("dirto", 0);</script>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/ac-1</property>
<value>110</value>
</greater-than-equals>
</condition>
</binding>
</button>
<button>

View file

@ -292,6 +292,16 @@
<legend>DIR</legend>
<pref-height>25</pref-height>
<pref-width>40</pref-width>
<binding>
<command>nasal</command>
<script>mcdu.pagebutton("dir-to", 0);</script>
<condition>
<greater-than-equals>
<property>systems/electrical/bus/ac-2</property>
<value>110</value>
</greater-than-equals>
</condition>
</binding>
</button>
<button>