diff --git a/A320-main.xml b/A320-main.xml index e9f6956f..2726fd11 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -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 --> diff --git a/Nasal/FMGC/winds.nas b/Nasal/FMGC/winds.nas index d5658a28..0d3284d6 100644 --- a/Nasal/FMGC/winds.nas +++ b/Nasal/FMGC/winds.nas @@ -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() { diff --git a/Nasal/MCDU/DATA2.nas b/Nasal/MCDU/DATA2.nas new file mode 100644 index 00000000..650f8bd7 --- /dev/null +++ b/Nasal/MCDU/DATA2.nas @@ -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"); + } +} diff --git a/Nasal/MCDU/INITA.nas b/Nasal/MCDU/INITA.nas index 95e4b3df..5a9fef65 100644 --- a/Nasal/MCDU/INITA.nas +++ b/Nasal/MCDU/INITA.nas @@ -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") { diff --git a/Nasal/MCDU/MCDU.nas b/Nasal/MCDU/MCDU.nas index d80e6a8d..b6b2f294 100644 --- a/Nasal/MCDU/MCDU.nas +++ b/Nasal/MCDU/MCDU.nas @@ -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") { diff --git a/Nasal/MCDU/WINDCLB.nas b/Nasal/MCDU/WINDCLB.nas index f4f0aed8..891b4ee9 100644 --- a/Nasal/MCDU/WINDCLB.nas +++ b/Nasal/MCDU/WINDCLB.nas @@ -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); diff --git a/Nasal/MCDU/WINDCRZ.nas b/Nasal/MCDU/WINDCRZ.nas index 2da2717d..1912615c 100644 --- a/Nasal/MCDU/WINDCRZ.nas +++ b/Nasal/MCDU/WINDCRZ.nas @@ -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) { diff --git a/Nasal/MCDU/WINDDES.nas b/Nasal/MCDU/WINDDES.nas index fbf43257..e90e1967 100644 --- a/Nasal/MCDU/WINDDES.nas +++ b/Nasal/MCDU/WINDDES.nas @@ -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);