1
0
Fork 0

Add access to wind pages from DATA2, save previous page in winds

This commit is contained in:
Matthew Maring 2020-06-12 21:28:14 -04:00
parent 2da3114861
commit 80ef332f29
8 changed files with 23 additions and 3 deletions

View file

@ -4081,6 +4081,7 @@
<file>Aircraft/A320-family/Nasal/MCDU/PERFTO.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/RADNAV.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/DATA.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/DATA2.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/STATUS.nas</file>
</mcdu>
<!-- Canvas -->

View file

@ -141,6 +141,7 @@ var windController = {
winds: [[], [], []], #waypoint winds used if route includes navaids
nav_indicies: [[], [], []],
windSizes: [0, 0, 0],
accessPage: ["", ""],
#temporaryFlag: [0, 0],
init: func() {

15
Nasal/MCDU/DATA2.nas Normal file
View file

@ -0,0 +1,15 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var data2Input = func(key, i) {
if (key == "L5") {
if (canvas_mcdu.myCLBWIND[i] == nil) {
canvas_mcdu.myCLBWIND[i] = windCLBPage.new(i);
} else {
canvas_mcdu.myCLBWIND[i].reload();
}
fmgc.windController.accessPage[i] = "DATA2";
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
}
}

View file

@ -232,6 +232,7 @@ var initInputA = func(key, i) {
} else {
canvas_mcdu.myCLBWIND[i].reload();
}
fmgc.windController.accessPage[i] = "INITA";
setprop("MCDU[" ~ i ~ "]/page", "WINDCLB");
} else if (key == "R5") {
if (scratchpad == "CLR") {

View file

@ -409,6 +409,8 @@ var lskbutton = func(btn, i) {
printInput2("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA") {
dataInput("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DATA2") {
data2Input("L5",i);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("/MCDU[" ~ i ~ "]/page") == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(5);
} else if (getprop("/MCDU[" ~ i ~ "]/page") == "DEPARTURE") {

View file

@ -188,7 +188,7 @@ var windCLBPage = {
}
me.reload();
} else if (index == 6) {
setprop("/MCDU[" ~ me.computer ~ "]/page", "INITA");
setprop("/MCDU[" ~ me.computer ~ "]/page", fmgc.windController.accessPage[me.computer]);
} else if (me.items >= index) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) == 13) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);

View file

@ -269,7 +269,7 @@ var windCRZPage = {
}
me.reload();
} else if (index == 6) {
setprop("/MCDU[" ~ me.computer ~ "]/page", "INITA");
setprop("/MCDU[" ~ me.computer ~ "]/page", fmgc.windController.accessPage[me.computer]);
} else if (index == 5) {
var sts = size(mcdu_scratchpad.scratchpads[me.computer].scratchpad);
if (sts >= 7 and sts <= 9) {

View file

@ -203,7 +203,7 @@ var windDESPage = {
}
me.reload();
} else if (index == 6) {
setprop("/MCDU[" ~ me.computer ~ "]/page", "INITA");
setprop("/MCDU[" ~ me.computer ~ "]/page", fmgc.windController.accessPage[me.computer]);
} else if (me.items >= index) {
if (size(mcdu_scratchpad.scratchpads[me.computer].scratchpad) == 13) {
var winds = split("/", mcdu_scratchpad.scratchpads[me.computer].scratchpad);