diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index b7ba081b..50f119a1 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -2553,7 +2553,7 @@ false nasal - + @@ -2562,7 +2562,7 @@ false nasal - + @@ -2591,7 +2591,7 @@ false nasal - + @@ -2600,7 +2600,7 @@ false nasal - + @@ -2629,7 +2629,7 @@ false nasal - + @@ -2638,7 +2638,7 @@ false nasal - + @@ -2647,10 +2647,10 @@ nd_range instrumentation/efis/inputs/range-nm - 100 - 2045 - 4090 - 80135 + 10 0 + 20 45 + 40 90 + 80135 160180 320225 @@ -2668,7 +2668,7 @@ false nasal - + @@ -2677,7 +2677,7 @@ false nasal - + @@ -2686,10 +2686,10 @@ nd_range_fo instrumentation/efis[1]/inputs/range-nm - 100 - 2045 - 4090 - 80135 + 10 0 + 20 45 + 40 90 + 80135 160180 320225 diff --git a/Nasal/efis.nas b/Nasal/efis.nas index 02abbbc9..d31174aa 100644 --- a/Nasal/efis.nas +++ b/Nasal/efis.nas @@ -5,167 +5,155 @@ ############################################## setlistener("sim/signals/fdm-initialized", func { - setprop("/instrumentation/efis/nd/display-mode", "NAV"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 2); - setprop("/instrumentation/efis/inputs/range-nm", 20); - setprop("/instrumentation/efis/inputs/tfc", 0); + setprop("/instrumentation/efis[0]/nd/display-mode", "NAV"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2); + setprop("/instrumentation/efis[0]/inputs/range-nm", 20); + setprop("/instrumentation/efis[0]/inputs/tfc", 0); + setprop("/instrumentation/efis[0]/inputs/CSTR", 0); + setprop("/instrumentation/efis[0]/inputs/wpt", 0); + setprop("/instrumentation/efis[0]/inputs/VORD", 0); + setprop("/instrumentation/efis[0]/inputs/DME", 0); + setprop("/instrumentation/efis[0]/inputs/NDB", 0); + setprop("/instrumentation/efis[0]/inputs/arpt", 0); setprop("/instrumentation/efis[1]/nd/display-mode", "NAV"); setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2); setprop("/instrumentation/efis[1]/inputs/range-nm", 20); setprop("/instrumentation/efis[1]/inputs/tfc", 0); + setprop("/instrumentation/efis[1]/inputs/CSTR", 0); + setprop("/instrumentation/efis[1]/inputs/wpt", 0); + setprop("/instrumentation/efis[1]/inputs/VORD", 0); + setprop("/instrumentation/efis[1]/inputs/DME", 0); + setprop("/instrumentation/efis[1]/inputs/NDB", 0); + setprop("/instrumentation/efis[1]/inputs/arpt", 0); }); -# Captain - -var ctl_func = func(md,val) { - if(md == "range") { - var rng = getprop("/instrumentation/efis/inputs/range-nm"); - if(val ==1){ - rng = rng * 2; - if(rng > 320) rng = 320; - } else if(val = -1){ - rng = rng / 2; - if(rng < 10) rng = 10; - } - setprop("/instrumentation/efis/inputs/range-nm", rng); - } -} - -var mode_inc = func { - var mode = getprop("/instrumentation/efis/nd/display-mode"); - if (mode == "ILS") { - setprop("/instrumentation/efis/nd/display-mode", "VOR"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 1); - } else if (mode == "VOR") { - setprop("/instrumentation/efis/nd/display-mode", "NAV"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 2); - } else if (mode == "NAV") { - setprop("/instrumentation/efis/nd/display-mode", "ARC"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 3); - } else if (mode == "ARC") { - setprop("/instrumentation/efis/nd/display-mode", "PLAN"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 4); - } else { - return 0; +var setCptND = func(d) { + var mode = getprop("/instrumentation/efis[0]/nd/display-mode"); + + if (d == 1) { + if (mode == "ILS") { + setprop("/instrumentation/efis[0]/nd/display-mode", "VOR"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 1); + } else if (mode == "VOR") { + setprop("/instrumentation/efis[0]/nd/display-mode", "NAV"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2); + } else if (mode == "NAV") { + setprop("/instrumentation/efis[0]/nd/display-mode", "ARC"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 3); + } else if (mode == "ARC") { + setprop("/instrumentation/efis[0]/nd/display-mode", "PLAN"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 4); + } + } else if (d == -1) { + if (mode == "PLAN") { + setprop("/instrumentation/efis[0]/nd/display-mode", "ARC"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 3); + } else if (mode == "ARC") { + setprop("/instrumentation/efis[0]/nd/display-mode", "NAV"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 2); + } else if (mode == "NAV") { + setprop("/instrumentation/efis[0]/nd/display-mode", "VOR"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 1); + } else if (mode == "VOR") { + setprop("/instrumentation/efis[0]/nd/display-mode", "ILS"); + setprop("/instrumentation/efis[0]/mfd/pnl_mode-num", 0); + } } } -var mode_dec = func { - var mode = getprop("/instrumentation/efis/nd/display-mode"); - if (mode == "PLAN") { - setprop("/instrumentation/efis/nd/display-mode", "ARC"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 3); - } else if (mode == "ARC") { - setprop("/instrumentation/efis/nd/display-mode", "NAV"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 2); - } else if (mode == "NAV") { - setprop("/instrumentation/efis/nd/display-mode", "VOR"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 1); - } else if (mode == "VOR") { - setprop("/instrumentation/efis/nd/display-mode", "ILS"); - setprop("/instrumentation/efis/mfd/pnl_mode-num", 0); - } else { - return 0; +var setFoND = func(d) { + var mode = getprop("/instrumentation/efis[1]/nd/display-mode"); + + if (d == 1) { + if (mode == "ILS") { + setprop("/instrumentation/efis[1]/nd/display-mode", "VOR"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1); + } else if (mode == "VOR") { + setprop("/instrumentation/efis[1]/nd/display-mode", "NAV"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2); + } else if (mode == "NAV") { + setprop("/instrumentation/efis[1]/nd/display-mode", "ARC"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3); + } else if (mode == "ARC") { + setprop("/instrumentation/efis[1]/nd/display-mode", "PLAN"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 4); + } + } else if (d == -1) { + if (mode == "PLAN") { + setprop("/instrumentation/efis[1]/nd/display-mode", "ARC"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3); + } else if (mode == "ARC") { + setprop("/instrumentation/efis[1]/nd/display-mode", "NAV"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2); + } else if (mode == "NAV") { + setprop("/instrumentation/efis[1]/nd/display-mode", "VOR"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1); + } else if (mode == "VOR") { + setprop("/instrumentation/efis[1]/nd/display-mode", "ILS"); + setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 0); + } } } +var setNDRange = func(n, d) { + var rng = getprop("/instrumentation/efis[" ~ n ~ "]/inputs/range-nm"); + if (d == 1) { + rng = rng * 2; + if (rng > 320) { + rng = 320; + } + } else if (d == -1){ + rng = rng / 2; + if (rng < 10) { + rng = 10; + } + } + setprop("/instrumentation/efis[" ~ n ~ "]/inputs/range-nm", rng); +} + var cpt_efis_btns = func(i) { if (i == "cstr") { - setprop("/instrumentation/efis/inputs/CSTR", 1); - setprop("/instrumentation/efis/inputs/wpt", 0); - setprop("/instrumentation/efis/inputs/VORD", 0); - setprop("/instrumentation/efis/inputs/DME", 0); - setprop("/instrumentation/efis/inputs/NDB", 0); - setprop("/instrumentation/efis/inputs/arpt", 0); + setprop("/instrumentation/efis[0]/inputs/CSTR", 1); + setprop("/instrumentation/efis[0]/inputs/wpt", 0); + setprop("/instrumentation/efis[0]/inputs/VORD", 0); + setprop("/instrumentation/efis[0]/inputs/DME", 0); + setprop("/instrumentation/efis[0]/inputs/NDB", 0); + setprop("/instrumentation/efis[0]/inputs/arpt", 0); } else if (i == "wpt") { - setprop("/instrumentation/efis/inputs/CSTR", 0); - setprop("/instrumentation/efis/inputs/wpt", 1); - setprop("/instrumentation/efis/inputs/VORD", 0); - setprop("/instrumentation/efis/inputs/DME", 0); - setprop("/instrumentation/efis/inputs/NDB", 0); - setprop("/instrumentation/efis/inputs/arpt", 0); + setprop("/instrumentation/efis[0]/inputs/CSTR", 0); + setprop("/instrumentation/efis[0]/inputs/wpt", 1); + setprop("/instrumentation/efis[0]/inputs/VORD", 0); + setprop("/instrumentation/efis[0]/inputs/DME", 0); + setprop("/instrumentation/efis[0]/inputs/NDB", 0); + setprop("/instrumentation/efis[0]/inputs/arpt", 0); } else if (i == "vord") { - setprop("/instrumentation/efis/inputs/CSTR", 0); - setprop("/instrumentation/efis/inputs/wpt", 0); - setprop("/instrumentation/efis/inputs/VORD", 1); - setprop("/instrumentation/efis/inputs/DME", 1); - setprop("/instrumentation/efis/inputs/NDB", 0); - setprop("/instrumentation/efis/inputs/arpt", 0); + setprop("/instrumentation/efis[0]/inputs/CSTR", 0); + setprop("/instrumentation/efis[0]/inputs/wpt", 0); + setprop("/instrumentation/efis[0]/inputs/VORD", 1); + setprop("/instrumentation/efis[0]/inputs/DME", 1); + setprop("/instrumentation/efis[0]/inputs/NDB", 0); + setprop("/instrumentation/efis[0]/inputs/arpt", 0); } else if (i == "ndb") { - setprop("/instrumentation/efis/inputs/CSTR", 0); - setprop("/instrumentation/efis/inputs/wpt", 0); - setprop("/instrumentation/efis/inputs/VORD", 0); - setprop("/instrumentation/efis/inputs/DME", 0); - setprop("/instrumentation/efis/inputs/NDB", 1); - setprop("/instrumentation/efis/inputs/arpt", 0); + setprop("/instrumentation/efis[0]/inputs/CSTR", 0); + setprop("/instrumentation/efis[0]/inputs/wpt", 0); + setprop("/instrumentation/efis[0]/inputs/VORD", 0); + setprop("/instrumentation/efis[0]/inputs/DME", 0); + setprop("/instrumentation/efis[0]/inputs/NDB", 1); + setprop("/instrumentation/efis[0]/inputs/arpt", 0); } else if (i == "arpt") { - setprop("/instrumentation/efis/inputs/CSTR", 0); - setprop("/instrumentation/efis/inputs/wpt", 0); - setprop("/instrumentation/efis/inputs/VORD", 0); - setprop("/instrumentation/efis/inputs/DME", 0); - setprop("/instrumentation/efis/inputs/NDB", 0); - setprop("/instrumentation/efis/inputs/arpt", 1); + setprop("/instrumentation/efis[0]/inputs/CSTR", 0); + setprop("/instrumentation/efis[0]/inputs/wpt", 0); + setprop("/instrumentation/efis[0]/inputs/VORD", 0); + setprop("/instrumentation/efis[0]/inputs/DME", 0); + setprop("/instrumentation/efis[0]/inputs/NDB", 0); + setprop("/instrumentation/efis[0]/inputs/arpt", 1); } else if (i == "off") { - setprop("/instrumentation/efis/inputs/CSTR", 0); - setprop("/instrumentation/efis/inputs/wpt", 0); - setprop("/instrumentation/efis/inputs/VORD", 0); - setprop("/instrumentation/efis/inputs/DME", 0); - setprop("/instrumentation/efis/inputs/NDB", 0); - setprop("/instrumentation/efis/inputs/arpt", 0); - } -} - -# First Officer - -var ctl2_func = func(md,val) { - if(md == "range") { - var rng = getprop("/instrumentation/efis[1]/inputs/range-nm"); - if(val ==1){ - rng = rng * 2; - if(rng > 320) rng = 320; - } else if(val = -1){ - rng = rng / 2; - if(rng < 10) rng = 10; - } - setprop("/instrumentation/efis[1]/inputs/range-nm", rng); - } -} - -var mode2_inc = func { - var mode = getprop("/instrumentation/efis[1]/nd/display-mode"); - if (mode == "ILS") { - setprop("/instrumentation/efis[1]/nd/display-mode", "VOR"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1); - } else if (mode == "VOR") { - setprop("/instrumentation/efis[1]/nd/display-mode", "NAV"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2); - } else if (mode == "NAV") { - setprop("/instrumentation/efis[1]/nd/display-mode", "ARC"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3); - } else if (mode == "ARC") { - setprop("/instrumentation/efis[1]/nd/display-mode", "PLAN"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 4); - } else { - return 0; - } -} - -var mode2_dec = func { - var mode = getprop("/instrumentation/efis[1]/nd/display-mode"); - if (mode == "PLAN") { - setprop("/instrumentation/efis[1]/nd/display-mode", "ARC"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 3); - } else if (mode == "ARC") { - setprop("/instrumentation/efis[1]/nd/display-mode", "NAV"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 2); - } else if (mode == "NAV") { - setprop("/instrumentation/efis[1]/nd/display-mode", "VOR"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 1); - } else if (mode == "VOR") { - setprop("/instrumentation/efis[1]/nd/display-mode", "ILS"); - setprop("/instrumentation/efis[1]/mfd/pnl_mode-num", 0); - } else { - return 0; + setprop("/instrumentation/efis[0]/inputs/CSTR", 0); + setprop("/instrumentation/efis[0]/inputs/wpt", 0); + setprop("/instrumentation/efis[0]/inputs/VORD", 0); + setprop("/instrumentation/efis[0]/inputs/DME", 0); + setprop("/instrumentation/efis[0]/inputs/NDB", 0); + setprop("/instrumentation/efis[0]/inputs/arpt", 0); } } diff --git a/revision.txt b/revision.txt index 775acee5..4a57c83e 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4689 \ No newline at end of file +4690 \ No newline at end of file