From 1a4f497c7fc73e304b5b31138788c8c8b3b13c05 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Tue, 13 Jun 2017 16:46:37 -0400 Subject: [PATCH] Improve CLB and CRZ MCDU --- Models/Instruments/MCDU1/PERF/CLB/CLB.xml | 47 +++++++++++++++ Models/Instruments/MCDU1/PERF/CRZ/CRZ.xml | 70 +++++++++++++++++++---- Models/Instruments/MCDU2/PERF/CLB/CLB.xml | 47 +++++++++++++++ Models/Instruments/MCDU2/PERF/CRZ/CRZ.xml | 70 +++++++++++++++++++---- Nasal/FMGC.nas | 6 +- Nasal/MCDU/MCDU1.nas | 62 +++++++++++++++----- Nasal/MCDU/MCDU2.nas | 62 +++++++++++++++----- 7 files changed, 312 insertions(+), 52 deletions(-) diff --git a/Models/Instruments/MCDU1/PERF/CLB/CLB.xml b/Models/Instruments/MCDU1/PERF/CLB/CLB.xml index 11cc7d96..99db7981 100644 --- a/Models/Instruments/MCDU1/PERF/CLB/CLB.xml +++ b/Models/Instruments/MCDU1/PERF/CLB/CLB.xml @@ -95,6 +95,51 @@ + + actmode3 + + -0.001 + -0.045 + 0.0705 + + left-center + yz-plane + text-value + SELECTED + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0040 + + 64 + 64 + + + + + select + actmode2 + + + /it-autoflight/input/spd-managed + 1 + + + + + select + actmode3 + + + /it-autoflight/input/spd-managed + 0 + + + + timedest @@ -457,6 +502,7 @@ previous phase2 timedest + presel 1 1 @@ -484,6 +530,7 @@ material efob2 actmode2 + actmode3 timedest2 0.2 diff --git a/Models/Instruments/MCDU1/PERF/CRZ/CRZ.xml b/Models/Instruments/MCDU1/PERF/CRZ/CRZ.xml index 0cdbe6e3..2b41f417 100644 --- a/Models/Instruments/MCDU1/PERF/CRZ/CRZ.xml +++ b/Models/Instruments/MCDU1/PERF/CRZ/CRZ.xml @@ -48,7 +48,7 @@ - actmode3 + actmode -0.001 -0.045 @@ -72,7 +72,7 @@ - actmode4 + actmode2 -0.001 -0.045 @@ -95,6 +95,51 @@ + + actmode3 + + -0.001 + -0.045 + 0.0705 + + left-center + yz-plane + text-value + SELECTED + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0040 + + 64 + 64 + + + + + select + actmode2 + + + /it-autoflight/input/spd-managed + 1 + + + + + select + actmode3 + + + /it-autoflight/input/spd-managed + 0 + + + + timedest3 @@ -192,7 +237,7 @@ - ci5 + ci -0.001 -0.045 @@ -216,7 +261,7 @@ - ci6 + ci2 -0.001 -0.045 @@ -239,7 +284,7 @@ - ci7 + ci3 -0.001 -0.045 @@ -264,14 +309,14 @@ select - ci6 + ci2 /FMGC/internal/cost-index-set select - ci7 + ci3 /FMGC/internal/cost-index-set @@ -520,9 +565,9 @@ material page - actmode3 + actmode managed2 - ci5 + ci efob3 next2 phase3 @@ -558,7 +603,8 @@ material efob4 - actmode4 + actmode2 + actmode3 timedest4 0.2 @@ -586,8 +632,8 @@ material presel4 - ci6 - ci7 + ci2 + ci3 descabinrate 0 diff --git a/Models/Instruments/MCDU2/PERF/CLB/CLB.xml b/Models/Instruments/MCDU2/PERF/CLB/CLB.xml index 11cc7d96..99db7981 100644 --- a/Models/Instruments/MCDU2/PERF/CLB/CLB.xml +++ b/Models/Instruments/MCDU2/PERF/CLB/CLB.xml @@ -95,6 +95,51 @@ + + actmode3 + + -0.001 + -0.045 + 0.0705 + + left-center + yz-plane + text-value + SELECTED + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0040 + + 64 + 64 + + + + + select + actmode2 + + + /it-autoflight/input/spd-managed + 1 + + + + + select + actmode3 + + + /it-autoflight/input/spd-managed + 0 + + + + timedest @@ -457,6 +502,7 @@ previous phase2 timedest + presel 1 1 @@ -484,6 +530,7 @@ material efob2 actmode2 + actmode3 timedest2 0.2 diff --git a/Models/Instruments/MCDU2/PERF/CRZ/CRZ.xml b/Models/Instruments/MCDU2/PERF/CRZ/CRZ.xml index 0cdbe6e3..2b41f417 100644 --- a/Models/Instruments/MCDU2/PERF/CRZ/CRZ.xml +++ b/Models/Instruments/MCDU2/PERF/CRZ/CRZ.xml @@ -48,7 +48,7 @@ - actmode3 + actmode -0.001 -0.045 @@ -72,7 +72,7 @@ - actmode4 + actmode2 -0.001 -0.045 @@ -95,6 +95,51 @@ + + actmode3 + + -0.001 + -0.045 + 0.0705 + + left-center + yz-plane + text-value + SELECTED + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0040 + + 64 + 64 + + + + + select + actmode2 + + + /it-autoflight/input/spd-managed + 1 + + + + + select + actmode3 + + + /it-autoflight/input/spd-managed + 0 + + + + timedest3 @@ -192,7 +237,7 @@ - ci5 + ci -0.001 -0.045 @@ -216,7 +261,7 @@ - ci6 + ci2 -0.001 -0.045 @@ -239,7 +284,7 @@ - ci7 + ci3 -0.001 -0.045 @@ -264,14 +309,14 @@ select - ci6 + ci2 /FMGC/internal/cost-index-set select - ci7 + ci3 /FMGC/internal/cost-index-set @@ -520,9 +565,9 @@ material page - actmode3 + actmode managed2 - ci5 + ci efob3 next2 phase3 @@ -558,7 +603,8 @@ material efob4 - actmode4 + actmode2 + actmode3 timedest4 0.2 @@ -586,8 +632,8 @@ material presel4 - ci6 - ci7 + ci2 + ci3 descabinrate 0 diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index 319dfd62..4d663665 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -115,6 +115,7 @@ var phasecheck = maketimer(0.2, func { if ((((n1_left >= 85) and (n1_right >= 85)) or (gs > 90 )) and flaps < 4 and (mode == "SRS")) { setprop("/FMGC/status/phase", "1"); + setprop("/systems/pressurization/mode", "TO"); } if ((aglalt >= reduc_agl_ft) and (alt <= cruiseft) and (phase == "1") and (phase != "4") and (mode != "SRS")) { @@ -128,6 +129,7 @@ var phasecheck = maketimer(0.2, func { if (alt <= cruiseft and (mode == "DES" or mode == "OP DES") and phase == "3") { setprop("/FMGC/status/phase", "4"); + setprop("/systems/pressurization/mode", "DE"); } if (getprop("/FMGC/status/to-state") == 0 and flaps >= 3 and ((phase == "3") or (phase == "4")) and alt < 7200) { @@ -177,10 +179,10 @@ var phasecheck = maketimer(0.2, func { setprop("/FMGC/internal/minspeed", 159); } else if (flap == 4) { setprop("/FMGC/internal/overspeed", 174); - setprop("/FMGC/internal/minspeed", 146); + setprop("/FMGC/internal/minspeed", 149); } else if (flap == 5) { setprop("/FMGC/internal/overspeed", 163); - setprop("/FMGC/internal/minspeed", 136); + setprop("/FMGC/internal/minspeed", 139); } }); diff --git a/Nasal/MCDU/MCDU1.nas b/Nasal/MCDU/MCDU1.nas index d92a0c38..16c50ef9 100644 --- a/Nasal/MCDU/MCDU1.nas +++ b/Nasal/MCDU/MCDU1.nas @@ -53,41 +53,58 @@ var lskbutton = func(btn) { setprop("/MCDU[0]/scratchpad-msg", "1"); setprop("/MCDU[0]/scratchpad", "GPS PRIMARY"); } else if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("L1"); + perfTOInput("L1"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("L1"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "2") { if (getprop("/MCDU[0]/page") == "INITA") { PerfInput("L2"); } else if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("L2"); + perfTOInput("L2"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("L2"); + } else if (getprop("/MCDU[0]/page") == "CLB") { + initInputA("L5"); # Does the same thing as on the INIT page + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "3") { if (getprop("/MCDU[0]/page") == "INITA") { initInputA("L3"); } else if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("L3"); + perfTOInput("L3"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("L3"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "4") { if (getprop("/MCDU[0]/page") == "DATA") { setprop("/MCDU[0]/page", "STATUS"); } else if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("L4"); + perfTOInput("L4"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("L4"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "5") { if (getprop("/MCDU[0]/page") == "INITA") { initInputA("L5"); } else if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("L5"); + perfTOInput("L5"); } else if (getprop("/MCDU[0]/page") == "CLB") { perfCLBInput("L5"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "6") { if (getprop("/MCDU[0]/page") == "INITA") { @@ -96,6 +113,9 @@ var lskbutton = func(btn) { perfCLBInput("L6"); } else if (getprop("/MCDU[0]/page") == "CRZ") { perfCRZInput("L6"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } } @@ -110,37 +130,53 @@ var rskbutton = func(btn) { initInputA("R1"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("R1"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "2") { if (getprop("/MCDU[0]/page") == "INITB") { initInputB("R2"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("R2"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "3") { if (getprop("/MCDU[0]/page") == "INITA") { initInputA("R3"); } else if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("R3"); + perfTOInput("R3"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "4") { if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("R4"); + perfTOInput("R4"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("R4"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "5") { if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("R5"); + perfTOInput("R5"); + } else { + setprop("/MCDU[0]/scratchpad-msg", "1"); + setprop("/MCDU[0]/scratchpad", "NOT ALLOWED"); } } else if (btn == "6") { if (getprop("/MCDU[0]/page") == "TO") { - PerfTOInput("R6"); + 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"); + } } } @@ -434,7 +470,7 @@ var initInputB = func(key) { } } -var PerfTOInput = func(key) { +var perfTOInput = func(key) { var scratchpad = getprop("/MCDU[0]/scratchpad"); if (key == "L1") { if (scratchpad == "CLR") { diff --git a/Nasal/MCDU/MCDU2.nas b/Nasal/MCDU/MCDU2.nas index a03d800d..79981f52 100644 --- a/Nasal/MCDU/MCDU2.nas +++ b/Nasal/MCDU/MCDU2.nas @@ -53,41 +53,58 @@ var lskbutton = func(btn) { setprop("/MCDU[1]/scratchpad-msg", "1"); setprop("/MCDU[1]/scratchpad", "GPS PRIMARY"); } else if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("L1"); + perfTOInput("L1"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("L1"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "2") { if (getprop("/MCDU[1]/page") == "INITA") { PerfInput("L2"); } else if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("L2"); + perfTOInput("L2"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("L2"); + } else if (getprop("/MCDU[1]/page") == "CLB") { + initInputA("L5"); # Does the same thing as on the INIT page + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "3") { if (getprop("/MCDU[1]/page") == "INITA") { initInputA("L3"); } else if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("L3"); + perfTOInput("L3"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("L3"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "4") { if (getprop("/MCDU[1]/page") == "DATA") { setprop("/MCDU[1]/page", "STATUS"); } else if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("L4"); + perfTOInput("L4"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("L4"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "5") { if (getprop("/MCDU[1]/page") == "INITA") { initInputA("L5"); } else if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("L5"); + perfTOInput("L5"); } else if (getprop("/MCDU[1]/page") == "CLB") { perfCLBInput("L5"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "6") { if (getprop("/MCDU[1]/page") == "INITA") { @@ -96,6 +113,9 @@ var lskbutton = func(btn) { perfCLBInput("L6"); } else if (getprop("/MCDU[1]/page") == "CRZ") { perfCRZInput("L6"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } } @@ -110,37 +130,53 @@ var rskbutton = func(btn) { initInputA("R1"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("R1"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "2") { if (getprop("/MCDU[1]/page") == "INITB") { initInputB("R2"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("R2"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "3") { if (getprop("/MCDU[1]/page") == "INITA") { initInputA("R3"); } else if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("R3"); + perfTOInput("R3"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "4") { if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("R4"); + perfTOInput("R4"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("R4"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "5") { if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("R5"); + perfTOInput("R5"); + } else { + setprop("/MCDU[1]/scratchpad-msg", "1"); + setprop("/MCDU[1]/scratchpad", "NOT ALLOWED"); } } else if (btn == "6") { if (getprop("/MCDU[1]/page") == "TO") { - PerfTOInput("R6"); + 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"); + } } } @@ -434,7 +470,7 @@ var initInputB = func(key) { } } -var PerfTOInput = func(key) { +var perfTOInput = func(key) { var scratchpad = getprop("/MCDU[1]/scratchpad"); if (key == "L1") { if (scratchpad == "CLR") {