From 649c61b2f0250dc53b3915e66b32415270e77c1a Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Thu, 15 Jun 2017 19:45:59 +0100 Subject: [PATCH] fix pneu and fadec bug, also add DES nasal and xml --- Models/Instruments/MCDU1/MCDU1.xml | 22 ++++++++++++++++++++++ Models/Instruments/MCDU2/MCDU2.xml | 22 ++++++++++++++++++++++ Nasal/MCDU/MCDU1.nas | 24 +++++++++++++++++++++--- Nasal/MCDU/MCDU2.nas | 24 +++++++++++++++++++++--- Nasal/fadec.nas | 1 + Nasal/pneumatics.nas | 2 ++ 6 files changed, 89 insertions(+), 6 deletions(-) diff --git a/Models/Instruments/MCDU1/MCDU1.xml b/Models/Instruments/MCDU1/MCDU1.xml index 02c9adc1..848fab66 100644 --- a/Models/Instruments/MCDU1/MCDU1.xml +++ b/Models/Instruments/MCDU1/MCDU1.xml @@ -202,6 +202,28 @@ + + DES + PERF/DES/DES.xml + + 180 + 180 + 90 + + + + + /systems/electrical/bus/ac1 + 110 + + + /MCDU[0]/page + DES + + + + + DATA2 DATA2/DATA2.xml diff --git a/Models/Instruments/MCDU2/MCDU2.xml b/Models/Instruments/MCDU2/MCDU2.xml index 29c9968f..0bc0cdef 100644 --- a/Models/Instruments/MCDU2/MCDU2.xml +++ b/Models/Instruments/MCDU2/MCDU2.xml @@ -202,6 +202,28 @@ + + DES + PERF/DES/DES.xml + + 180 + 180 + 90 + + + + + /systems/electrical/bus/ac2 + 110 + + + /MCDU[1]/page + DES + + + + + DATA2 DATA2/DATA2.xml diff --git a/Nasal/MCDU/MCDU1.nas b/Nasal/MCDU/MCDU1.nas index a390fee1..5ab3650f 100644 --- a/Nasal/MCDU/MCDU1.nas +++ b/Nasal/MCDU/MCDU1.nas @@ -69,6 +69,10 @@ var lskbutton = func(btn) { radnavInput("L2"); } else if (getprop("/MCDU[0]/page") == "CLB") { initInputA("L5"); # Does the same thing as on the INIT page + } else if (getprop("/MCDU[0]/page") == "CRZ") { + initInputA("L5"); + } else if (getprop("/MCDU[0]/page") == "DES") { + initInputA("L5"); } else { setprop("/MCDU[0]/scratchpad-msg", "1"); setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); @@ -102,6 +106,10 @@ var lskbutton = func(btn) { perfTOInput("L5"); } else if (getprop("/MCDU[0]/page") == "CLB") { perfCLBInput("L5"); + } else if (getprop("/MCDU[0]/page") == "CRZ") { + perfCRZInput("L5"); + } else if (getprop("/MCDU[0]/page") == "DES") { + perfDESInput("L5"); } else { setprop("/MCDU[0]/scratchpad-msg", "1"); setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); @@ -113,6 +121,8 @@ var lskbutton = func(btn) { perfCLBInput("L6"); } else if (getprop("/MCDU[0]/page") == "CRZ") { perfCRZInput("L6"); + } else if (getprop("/MCDU[0]/page") == "DES") { + perfDESInput("L6"); } else { setprop("/MCDU[0]/scratchpad-msg", "1"); setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); @@ -173,6 +183,8 @@ var rskbutton = func(btn) { perfTOInput("R6"); } else if (getprop("/MCDU[0]/page") == "CLB") { perfCLBInput("R6"); + } else if (getprop("/MCDU[0]/page") == "CRZ") { + perfCRZInput("R6"); } else { setprop("/MCDU[0]/scratchpad-msg", "1"); setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); @@ -688,9 +700,15 @@ var perfCRZInput = func(key) { if (key == "L6") { setprop("/MCDU[0]/page", "CLB"); } - # if (key == "R6") { - # setprop("/MCDU[0]/page", "DES"); - # } + if (key == "R6") { + setprop("/MCDU[0]/page", "DES"); + } +} + +var perfDESInput = func(key) { + if (key == "L6") { + setprop("/MCDU[0]/page", "CRZ"); + } } var arrowbutton = func(btn) { diff --git a/Nasal/MCDU/MCDU2.nas b/Nasal/MCDU/MCDU2.nas index 907476bd..7d086ead 100644 --- a/Nasal/MCDU/MCDU2.nas +++ b/Nasal/MCDU/MCDU2.nas @@ -69,6 +69,10 @@ var lskbutton = func(btn) { radnavInput("L2"); } else if (getprop("/MCDU[1]/page") == "CLB") { initInputA("L5"); # Does the same thing as on the INIT page + } else if (getprop("/MCDU[0]/page") == "CRZ") { + initInputA("L5"); + } else if (getprop("/MCDU[0]/page") == "DES") { + initInputA("L5"); } else { setprop("/MCDU[1]/scratchpad-msg", "1"); setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); @@ -102,6 +106,10 @@ var lskbutton = func(btn) { perfTOInput("L5"); } else if (getprop("/MCDU[1]/page") == "CLB") { perfCLBInput("L5"); + } else if (getprop("/MCDU[1]/page") == "CRZ") { + perfCRZInput("L5"); + } else if (getprop("/MCDU[1]/page") == "DES") { + perfDESInput("L5"); } else { setprop("/MCDU[1]/scratchpad-msg", "1"); setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); @@ -113,6 +121,8 @@ var lskbutton = func(btn) { perfCLBInput("L6"); } else if (getprop("/MCDU[1]/page") == "CRZ") { perfCRZInput("L6"); + } else if (getprop("/MCDU[0]/page") == "DES") { + perfDESInput("L6"); } else { setprop("/MCDU[1]/scratchpad-msg", "1"); setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); @@ -173,6 +183,8 @@ var rskbutton = func(btn) { perfTOInput("R6"); } else if (getprop("/MCDU[1]/page") == "CLB") { perfCLBInput("R6"); + } else if (getprop("/MCDU[1]/page") == "CRZ") { + perfCRZInput("R6"); } else { setprop("/MCDU[1]/scratchpad-msg", "1"); setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); @@ -688,9 +700,15 @@ var perfCRZInput = func(key) { if (key == "L6") { setprop("/MCDU[1]/page", "CLB"); } - # if (key == "R6") { - # setprop("/MCDU[1]/page", "DES"); - # } + if (key == "R6") { + setprop("/MCDU[1]/page", "DES"); + } +} + +var perfDESInput = func(key) { + if (key == "L6") { + setprop("/MCDU[1]/page", "CRZ"); + } } var arrowbutton = func(btn) { diff --git a/Nasal/fadec.nas b/Nasal/fadec.nas index e8e56019..78b5af7f 100644 --- a/Nasal/fadec.nas +++ b/Nasal/fadec.nas @@ -23,6 +23,7 @@ setlistener("/sim/signals/fdm-initialized", func { setprop("/systems/thrust/mct-lim", 0.0); setprop("/systems/thrust/clb-lim", 0.0); setprop("/systems/thrust/lim-flex", 0); + setprop("/engines/flex-derate", 0); thrustt.start(); }); diff --git a/Nasal/pneumatics.nas b/Nasal/pneumatics.nas index 9374f4b0..6e77c312 100644 --- a/Nasal/pneumatics.nas +++ b/Nasal/pneumatics.nas @@ -51,6 +51,8 @@ var pneu_init = func { setprop("/systems/ventilation/avionics/inletvalve", "0"); setprop("/systems/ventilation/lavatory/extractfan", 0); setprop("/systems/ventilation/lavatory/extractvalve", "0"); + setprop("/systems/pressurization/ambientpsi", "0"); + setprop("/systems/pressurization/cabinpsi", "0"); pneu_timer.start(); }