From f8c758aec8d609eb60725ee8bed7a9426d7362c8 Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Fri, 28 Jul 2017 17:21:48 +0100 Subject: [PATCH] MCDU update --- A320-main.xml | 2 + Models/Instruments/MCDU1/DATA/IRSMON.xml | 139 +++++++++++++++++++++ Models/Instruments/MCDU1/MCDU1.xml | 22 ++++ Models/Instruments/MCDU1/STATUS/STATUS.xml | 34 ++++- Models/Instruments/MCDU2/DATA/IRSMON.xml | 139 +++++++++++++++++++++ Models/Instruments/MCDU2/MCDU2.xml | 22 ++++ Models/Instruments/MCDU2/STATUS/STATUS.xml | 34 ++++- Nasal/ADIRS.nas | 10 ++ Nasal/FMGC.nas | 15 +++ Nasal/MCDU1/DATA.nas | 3 + Nasal/MCDU1/MCDU.nas | 10 +- Nasal/MCDU1/STATUS.nas | 11 ++ Nasal/MCDU2/DATA.nas | 3 + Nasal/MCDU2/MCDU.nas | 10 +- Nasal/MCDU2/STATUS.nas | 11 ++ 15 files changed, 453 insertions(+), 12 deletions(-) create mode 100644 Models/Instruments/MCDU1/DATA/IRSMON.xml create mode 100644 Models/Instruments/MCDU2/DATA/IRSMON.xml create mode 100644 Nasal/MCDU1/STATUS.nas create mode 100644 Nasal/MCDU2/STATUS.nas diff --git a/A320-main.xml b/A320-main.xml index a91b0b18..b4378231 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1044,6 +1044,7 @@ Aircraft/A320Family/Nasal/MCDU1/PERFTO.nas Aircraft/A320Family/Nasal/MCDU1/RADNAV.nas Aircraft/A320Family/Nasal/MCDU1/DATA.nas + Aircraft/A320Family/Nasal/MCDU1/STATUS.nas Aircraft/A320Family/Nasal/MCDU2/MCDU.nas @@ -1056,6 +1057,7 @@ Aircraft/A320Family/Nasal/MCDU2/PERFTO.nas Aircraft/A320Family/Nasal/MCDU2/RADNAV.nas Aircraft/A320Family/Nasal/MCDU2/DATA.nas + Aircraft/A320Family/Nasal/MCDU2/STATUS.nas Aircraft/A320Family/Models/Instruments/ND/canvas/ND.nas diff --git a/Models/Instruments/MCDU1/DATA/IRSMON.xml b/Models/Instruments/MCDU1/DATA/IRSMON.xml new file mode 100644 index 00000000..d22f1d45 --- /dev/null +++ b/Models/Instruments/MCDU1/DATA/IRSMON.xml @@ -0,0 +1,139 @@ + + + + + + + EMPTY.ac + + + page + + -0.001 + 0.0 + 0.083 + + center-center + yz-plane + text-value + IRS MONITOR + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + irs1 + + -0.001 + -0.045 + 0.0715 + + left-center + yz-plane + text-value + <IRS1 + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + irs2 + + -0.001 + -0.045 + 0.061 + + left-center + yz-plane + text-value + <IRS2 + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + irs3 + + -0.001 + -0.045 + 0.0505 + + left-center + yz-plane + text-value + <IRS3 + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + + + material + page + irs1 + irs2 + irs3 + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 1 + 1 + 1 + + + + diff --git a/Models/Instruments/MCDU1/MCDU1.xml b/Models/Instruments/MCDU1/MCDU1.xml index 65494266..ce741a7f 100644 --- a/Models/Instruments/MCDU1/MCDU1.xml +++ b/Models/Instruments/MCDU1/MCDU1.xml @@ -180,6 +180,28 @@ + + IRSMON + DATA/IRSMON.xml + + 180 + 180 + 90 + + + + + systems/electrical/bus/ac1 + 110 + + + MCDU[0]/page + IRSMON + + + + + TO PERF/TO/TO.xml diff --git a/Models/Instruments/MCDU1/STATUS/STATUS.xml b/Models/Instruments/MCDU1/STATUS/STATUS.xml index 3b642eee..1fddc83c 100644 --- a/Models/Instruments/MCDU1/STATUS/STATUS.xml +++ b/Models/Instruments/MCDU1/STATUS/STATUS.xml @@ -114,10 +114,10 @@ left-center yz-plane text-value - 01JAN-28JAN + %s false BoeingCDU-Large.ttf - autopilot/serviceable + FMGC/internal/navdatabase true false false @@ -137,10 +137,10 @@ right-center yz-plane text-value - AB20170101 + %s false BoeingCDU-Large.ttf - autopilot/serviceable + FMGC/internal/navdatabasecode true false false @@ -184,7 +184,7 @@ left-center yz-plane text-value - <-29JAN-26FEB + <- false BoeingCDU-Large.ttf autopilot/serviceable @@ -197,6 +197,29 @@ 64 + + seconddata3 + + -0.001 + -0.040 + 0.0505 + + left-center + yz-plane + text-value + %s + false + BoeingCDU-Large.ttf + FMGC/internal/navdatabase2 + true + false + false + 0.0045 + + 64 + 64 + + chgcode @@ -406,6 +429,7 @@ material activedata2 seconddata2 + seconddata3 chgcode2 0 diff --git a/Models/Instruments/MCDU2/DATA/IRSMON.xml b/Models/Instruments/MCDU2/DATA/IRSMON.xml new file mode 100644 index 00000000..d22f1d45 --- /dev/null +++ b/Models/Instruments/MCDU2/DATA/IRSMON.xml @@ -0,0 +1,139 @@ + + + + + + + EMPTY.ac + + + page + + -0.001 + 0.0 + 0.083 + + center-center + yz-plane + text-value + IRS MONITOR + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + irs1 + + -0.001 + -0.045 + 0.0715 + + left-center + yz-plane + text-value + <IRS1 + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + irs2 + + -0.001 + -0.045 + 0.061 + + left-center + yz-plane + text-value + <IRS2 + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + irs3 + + -0.001 + -0.045 + 0.0505 + + left-center + yz-plane + text-value + <IRS3 + false + BoeingCDU-Large.ttf + autopilot/serviceable + true + false + false + 0.0050 + + 64 + 64 + + + + + + + material + page + irs1 + irs2 + irs3 + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 1 + 1 + 1 + + + + diff --git a/Models/Instruments/MCDU2/MCDU2.xml b/Models/Instruments/MCDU2/MCDU2.xml index c0024550..e6d74798 100644 --- a/Models/Instruments/MCDU2/MCDU2.xml +++ b/Models/Instruments/MCDU2/MCDU2.xml @@ -180,6 +180,28 @@ + + IRSMON + DATA/IRSMON.xml + + 180 + 180 + 90 + + + + + systems/electrical/bus/ac1 + 110 + + + MCDU[1]/page + IRSMON + + + + + TO PERF/TO/TO.xml diff --git a/Models/Instruments/MCDU2/STATUS/STATUS.xml b/Models/Instruments/MCDU2/STATUS/STATUS.xml index 3b642eee..1fddc83c 100644 --- a/Models/Instruments/MCDU2/STATUS/STATUS.xml +++ b/Models/Instruments/MCDU2/STATUS/STATUS.xml @@ -114,10 +114,10 @@ left-center yz-plane text-value - 01JAN-28JAN + %s false BoeingCDU-Large.ttf - autopilot/serviceable + FMGC/internal/navdatabase true false false @@ -137,10 +137,10 @@ right-center yz-plane text-value - AB20170101 + %s false BoeingCDU-Large.ttf - autopilot/serviceable + FMGC/internal/navdatabasecode true false false @@ -184,7 +184,7 @@ left-center yz-plane text-value - <-29JAN-26FEB + <- false BoeingCDU-Large.ttf autopilot/serviceable @@ -197,6 +197,29 @@ 64 + + seconddata3 + + -0.001 + -0.040 + 0.0505 + + left-center + yz-plane + text-value + %s + false + BoeingCDU-Large.ttf + FMGC/internal/navdatabase2 + true + false + false + 0.0045 + + 64 + 64 + + chgcode @@ -406,6 +429,7 @@ material activedata2 seconddata2 + seconddata3 chgcode2 0 diff --git a/Nasal/ADIRS.nas b/Nasal/ADIRS.nas index b36e5f58..baaa97b6 100644 --- a/Nasal/ADIRS.nas +++ b/Nasal/ADIRS.nas @@ -62,6 +62,16 @@ var ADIRSreset = func { setprop("/controls/adirs/ir[2]/fault",0); setprop("/controls/adirs/onbat",0); setprop("/controls/adirs/mcducbtn",0); + setprop("/controls/adirs/mcdu/mode1", ""); # INVAL ALIGN NAV ATT or off (blank) + setprop("/controls/adirs/mcdu/mode2", ""); + setprop("/controls/adirs/mcdu/mode3", ""); + setprop("/controls/adirs/mcdu/status1", ""); # see smith thales p487 + setprop("/controls/adirs/mcdu/status2", ""); + setprop("/controls/adirs/mcdu/status3", ""); + setprop("/controls/adirs/mcdu/hdg", ""); # only shown if in ATT mode + setprop("/controls/adirs/mcdu/avgdrift1", ""); + setprop("/controls/adirs/mcdu/avgdrift2", ""); + setprop("/controls/adirs/mcdu/avgdrift3", ""); adirs_init(); } diff --git a/Nasal/FMGC.nas b/Nasal/FMGC.nas index eba656ba..7d9d91a7 100644 --- a/Nasal/FMGC.nas +++ b/Nasal/FMGC.nas @@ -27,6 +27,10 @@ setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99"); setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX"); setlistener("/sim/signals/fdm-initialized", func { + var database1 = getprop("/FMGC/internal/navdatabase"); + var database2 = getprop("/FMGC/internal/navdatabase2"); + var code1 = getprop("/FMGC/internal/navdatabasecode"); + var code2 = getprop("/FMGC/internal/navdatabasecode2"); var gear1 = getprop("/gear/gear[1]/wow"); var gear2 = getprop("/gear/gear[2]/wow"); var state1 = getprop("/systems/thrust/state1"); @@ -527,3 +531,14 @@ var ManagedSPD = maketimer(0.25, func { libraries.mcpSPDKnbPull(); } }); + +var switchDatabase = func { + database1 = getprop("/FMGC/internal/navdatabase"); + database2 = getprop("/FMGC/internal/navdatabase2"); + code1 = getprop("/FMGC/internal/navdatabasecode"); + code2 = getprop("/FMGC/internal/navdatabasecode2"); + setprop("/FMGC/internal/navdatabase", database2); + setprop("/FMGC/internal/navdatabase2", database1); + setprop("/FMGC/internal/navdatabasecode", code2); + setprop("/FMGC/internal/navdatabasecode2", code1); +} \ No newline at end of file diff --git a/Nasal/MCDU1/DATA.nas b/Nasal/MCDU1/DATA.nas index c2aac9b6..089cdce6 100644 --- a/Nasal/MCDU1/DATA.nas +++ b/Nasal/MCDU1/DATA.nas @@ -8,4 +8,7 @@ var dataInput = func(key) { if (key == "L1") { setprop("/MCDU[0]/page", "POSMON"); } + if (key == "L2") { + setprop("/MCDU[0]/page", "IRSMON"); + } } diff --git a/Nasal/MCDU1/MCDU.nas b/Nasal/MCDU1/MCDU.nas index eee2dc25..f64cea11 100644 --- a/Nasal/MCDU1/MCDU.nas +++ b/Nasal/MCDU1/MCDU.nas @@ -52,6 +52,10 @@ var MCDU_reset = func { setprop("/FMGC/internal/vor2crs-set", 0); setprop("/FMGC/internal/adf1freq-set", 0); setprop("/FMGC/internal/adf2freq-set", 0); + setprop("/FMGC/internal/navdatabase", "01JAN-28JAN"); + setprop("/FMGC/internal/navdatabase2", "29JAN-26FEB"); + setprop("/FMGC/internal/navdatabasecode", "AB20170101"); + setprop("/FMGC/internal/navdatabasecode2", "AB20170102"); } var lskbutton = func(btn) { @@ -86,7 +90,9 @@ var lskbutton = func(btn) { initInputA("L5"); } else if (getprop("/MCDU[0]/page") == "DES") { initInputA("L5"); - } else { + } else if (getprop("/MCDU[0]/page") == "DATA") { + dataInput("L2"); + } else { if (getprop("/MCDU[0]/scratchpad") != "NOT ALLOWED") { setprop("/MCDU[0]/last-scratchpad", getprop("/MCDU[0]/scratchpad")); } @@ -98,6 +104,8 @@ var lskbutton = func(btn) { initInputA("L3"); } else if (getprop("/MCDU[0]/page") == "TO") { perfTOInput("L3"); + } else if (getprop("/MCDU[0]/page") == "STATUS") { + statusInput("L3"); } else if (getprop("/MCDU[0]/page") == "RADNAV") { radnavInput("L3"); } else { diff --git a/Nasal/MCDU1/STATUS.nas b/Nasal/MCDU1/STATUS.nas new file mode 100644 index 00000000..8afd219c --- /dev/null +++ b/Nasal/MCDU1/STATUS.nas @@ -0,0 +1,11 @@ +# A3XX mCDU by Joshua Davidson (it0uchpods) and Jonathan Redpath + +####################################### +# Copyright (c) A3XX Development Team # +####################################### + +var statusInput = func(key) { + if (key == "L3") { + fmgc.switchDatabase(); + } +} diff --git a/Nasal/MCDU2/DATA.nas b/Nasal/MCDU2/DATA.nas index f2dc078a..5a41a290 100644 --- a/Nasal/MCDU2/DATA.nas +++ b/Nasal/MCDU2/DATA.nas @@ -8,4 +8,7 @@ var dataInput = func(key) { if (key == "L1") { setprop("/MCDU[1]/page", "POSMON"); } + if (key == "L2") { + setprop("/MCDU[1]/page", "IRSMON"); + } } diff --git a/Nasal/MCDU2/MCDU.nas b/Nasal/MCDU2/MCDU.nas index 53cfd6af..925d4333 100644 --- a/Nasal/MCDU2/MCDU.nas +++ b/Nasal/MCDU2/MCDU.nas @@ -52,6 +52,10 @@ var MCDU_reset = func { setprop("/FMGC/internal/vor2crs-set", 0); setprop("/FMGC/internal/adf1freq-set", 0); setprop("/FMGC/internal/adf2freq-set", 0); + setprop("/FMGC/internal/navdatabase", "01JAN-28JAN"); + setprop("/FMGC/internal/navdatabase2", "29JAN-26FEB"); + setprop("/FMGC/internal/navdatabasecode", "AB20170101"); + setprop("/FMGC/internal/navdatabasecode2", "AB20170102"); } var lskbutton = func(btn) { @@ -86,7 +90,9 @@ var lskbutton = func(btn) { initInputA("L5"); } else if (getprop("/MCDU[1]/page") == "DES") { initInputA("L5"); - } else { + } else if (getprop("/MCDU[1]/page") == "DATA") { + dataInput("L2"); + } else { if (getprop("/MCDU[1]/scratchpad") != "NOT ALLOWED") { setprop("/MCDU[1]/last-scratchpad", getprop("/MCDU[1]/scratchpad")); } @@ -98,6 +104,8 @@ var lskbutton = func(btn) { initInputA("L3"); } else if (getprop("/MCDU[1]/page") == "TO") { perfTOInput("L3"); + } else if (getprop("/MCDU[1]/page") == "STATUS") { + statusInput("L3"); } else if (getprop("/MCDU[1]/page") == "RADNAV") { radnavInput("L3"); } else { diff --git a/Nasal/MCDU2/STATUS.nas b/Nasal/MCDU2/STATUS.nas new file mode 100644 index 00000000..8afd219c --- /dev/null +++ b/Nasal/MCDU2/STATUS.nas @@ -0,0 +1,11 @@ +# A3XX mCDU by Joshua Davidson (it0uchpods) and Jonathan Redpath + +####################################### +# Copyright (c) A3XX Development Team # +####################################### + +var statusInput = func(key) { + if (key == "L3") { + fmgc.switchDatabase(); + } +}