From cafa1d6001572e185a089978ec1eab52000d5b0c Mon Sep 17 00:00:00 2001 From: merspieler Date: Wed, 26 Sep 2018 20:42:57 +0200 Subject: [PATCH] Added functionality to the RMP. VHF1 + VHF2 fully working Signed-off-by: merspieler --- A320-main.xml | 3 + Models/FlightDeck/a320.flightdeck.xml | 12 - Models/Instruments/Radio/Radio.nas | 234 ++++ Models/Instruments/Radio/Radio1.xml | 1517 ++++++++++++++++++++++++- Models/Instruments/Radio/Radio2.xml | 1517 ++++++++++++++++++++++++- Nasal/libraries.nas | 1 + 6 files changed, 3260 insertions(+), 24 deletions(-) create mode 100644 Models/Instruments/Radio/Radio.nas diff --git a/A320-main.xml b/A320-main.xml index 1c6f4db3..18e6b3f0 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -1547,6 +1547,9 @@ Aircraft/IDG-A32X/Nasal/autopush_route.nas + + Aircraft/IDG-A32X/Models/Instruments/Radio/Radio.nas + diff --git a/Models/FlightDeck/a320.flightdeck.xml b/Models/FlightDeck/a320.flightdeck.xml index 56e4ac02..e5c9f47c 100644 --- a/Models/FlightDeck/a320.flightdeck.xml +++ b/Models/FlightDeck/a320.flightdeck.xml @@ -488,19 +488,7 @@ master_caution_on master_warning_on qnh-test - radio_adf_led - radio_am_led - radio_bfo_led - radio_hf1_led - radio_hf2_led - radio_ls_led - radio_nav_led radio_opt_led - radio_sel_led - radio_vhf1_led - radio_vhf2_led - radio_vhf3_led - radio_vor_led rudder-trim-test spd-text-test terr_on_nd_on diff --git a/Models/Instruments/Radio/Radio.nas b/Models/Instruments/Radio/Radio.nas new file mode 100644 index 00000000..bf77e446 --- /dev/null +++ b/Models/Instruments/Radio/Radio.nas @@ -0,0 +1,234 @@ +# A3XX Radio Managment Panel +# merspieler + +############################ +# Copyright (c) merspieler # +############################ + +# GLOBAL TODO add stuff for HF1, HF2, VOR, LS and ADF + +var rmp_update = nil; + +var act_vhf1 = props.globals.getNode("/instrumentation/comm[0]/frequencies/selected-mhz-fmt"); +var act_vhf2 = props.globals.getNode("/instrumentation/comm[1]/frequencies/selected-mhz-fmt"); +# TODO when VHF3 is available uncomment this +#var act_vhf3 = props.globals.getNode("/instrumentation/comm[2]/frequencies/selected-mhz-fmt"); + +var act_display_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/active-display", "123.900"); +var stby_display_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/standby-display", "118.700"); +var stby_rmp1_vhf1 = props.globals.initNode("/systems/radio/rmp[0]/vhf1-standby", 118.7); +var stby_rmp1_vhf2 = props.globals.initNode("/systems/radio/rmp[0]/vhf2-standby", 123.12); +var stby_rmp1_vhf3 = props.globals.initNode("/systems/radio/rmp[0]/vhf3-standby", 121.5); + +var act_display_rmp2 = props.globals.initNode("/controls/radio/rmp[1]/active-display", "127.900"); +var stby_display_rmp2 = props.globals.initNode("/controls/radio/rmp[1]/standby-display", "123.125"); +var stby_rmp2_vhf1 = props.globals.initNode("/systems/radio/rmp[1]/vhf1-standby", 118.7); +var stby_rmp2_vhf2 = props.globals.initNode("/systems/radio/rmp[1]/vhf2-standby", 123.12); +var stby_rmp2_vhf3 = props.globals.initNode("/systems/radio/rmp[1]/vhf3-standby", 121.5); + +var act_display_rmp3 = props.globals.initNode("/controls/radio/rmp[2]/active-display", "127.900"); +var stby_display_rmp3 = props.globals.initNode("/controls/radio/rmp[2]/standby-display", "123.125"); +var stby_rmp3_vhf1 = props.globals.initNode("/systems/radio/rmp[2]/vhf1-standby", 118.7); +var stby_rmp3_vhf2 = props.globals.initNode("/systems/radio/rmp[2]/vhf2-standby", 123.12); +var stby_rmp3_vhf3 = props.globals.initNode("/systems/radio/rmp[2]/vhf3-standby", 121.5); + +var chan_rmp1 = props.globals.initNode("/systems/radio/rmp[0]/sel_chan", "vhf1"); +var chan_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/sel_chan", "vhf2"); +var chan_rmp3 = props.globals.initNode("/systems/radio/rmp[2]/sel_chan", "vhf3"); + +var init = func() { + for(var i = 0; i < 3; i += 1) { + setprop("/systems/radio/rmp[" ~ i ~ "]/hf1-standby", 510); + setprop("/systems/radio/rmp[" ~ i ~ "]/hf2-standby", 891); + } + + var rmp_update = maketimer(0.2, func { + rmp_refresh.update(); + }); +} + +var update_active_vhf = func(vhf) { + var sel1 = chan_rmp1.getValue(); + var sel2 = chan_rmp2.getValue(); +# In case that a 3rd RMP is added, uncomment the following line and expand the if statements with the sel3 comparison +# var sel3 = chan_rmp3.getValue(); + + if(vhf == 1) { + if(sel1 == "vhf1" or sel2 == "vhf1") { + var act = sprintf("%3.3f", act_vhf1.getValue()); + + if(sel1 == "vhf1") { + act_display_rmp1.setValue(act); + } + if(sel2 == "vhf1") { + act_display_rmp2.setValue(act); + } + } + } else if (vhf == 2) { + if(sel1 == "vhf2" or sel2 == "vhf2") { + var act = sprintf("%3.3f", act_vhf2.getValue()); + + if(sel1 == "vhf2") { + act_display_rmp1.setValue(act); + } + if(sel2 == "vhf2") { + act_display_rmp2.setValue(act); + } + } + } else { +# TODO when VHF3 is available uncomment this +# if(sel1 == "vhf2" or sel2 == "vhf2") { +# var act = sprintf("%3.3f", act_vhf2.getValue()); +# +# if(sel1 == "vhf2") { +# act_display_rmp1.setValue(act); +# } +# if(sel2 == "vhf2") { +# act_display_rmp2.setValue(act); +# } +# } + } +}; + +var update_stby_vhf = func(rmp_no, vhf) { + if(rmp_no == 0) { + if(vhf == 1) { + var stby = sprintf("%3.3f", stby_rmp1_vhf1.getValue()); + } else if(vhf == 2) { + var stby = sprintf("%3.3f", stby_rmp1_vhf2.getValue()); + } else { + var stby = sprintf("%3.3f", stby_rmp1_vhf3.getValue()); + } + + stby_display_rmp1.setValue(stby); + } else { + if(vhf == 1) { + var stby = sprintf("%3.3f", stby_rmp2_vhf1.getValue()); + } else if(vhf == 2) { + var stby = sprintf("%3.3f", stby_rmp2_vhf2.getValue()); + } else { + var stby = sprintf("%3.3f", stby_rmp2_vhf3.getValue()); + } + + stby_display_rmp2.setValue(stby); + } +} + +var update_chan_sel = func(rmp_no) { + update_active_vhf(1); + update_active_vhf(2); + update_active_vhf(3); + + if(rmp_no == 0) { + var chan = chan_rmp1.getValue(); + if(chan == "vhf1") { + update_stby_vhf(rmp_no, 1); + } else if(chan == "vhf1") { + update_stby_vhf(rmp_no, 2); + } else { + update_stby_vhf(rmp_no, 3); + } + } else if(rmp_no == 1) { + var chan = chan_rmp2.getValue(); + if(chan == "vhf1") { + update_stby_vhf(rmp_no, 1); + } else if(chan == "vhf2") { + update_stby_vhf(rmp_no, 2); + } else { + update_stby_vhf(rmp_no, 3); + } + } else { +# In case that a 3rd RMP is added, uncomment this +# var chan = chan_rmp3.getValue(); +# if(chan == "vhf1") { +# update_stby_vhf(rmp_no, 1); +# } else if(chan == "vhf2") { +# update_stby_vhf(rmp_no, 2); +# } else { +# update_stby_vhf(rmp_no, 3); +# } + } +} + +var transfer = func(rmp_no) { + + rmp_no = rmp_no - 1; + var sel_chan = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/sel_chan"); + + if(string.match(sel_chan, "vhf[1-3]")) { + var mod1 = int(string.replace(sel_chan, "vhf", "")); + var mod = mod1 - 1; + + # TODO remove this IF statement when /instrumentation/comm[2] was added + if(mod == 2) { return;} + + + var mem = getprop("/instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz"); + + setprop("/instrumentation/comm[" ~ mod ~ "]/frequencies/selected-mhz", getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby")); + setprop("/systems/radio/rmp[" ~ rmp_no ~ "]/vhf" ~ mod1 ~ "-standby", mem); + } +} + + +# In case that a 3rd RMP is added, increase the check in the following 3 loops to `i <= 2` +setlistener("/systems/radio/rmp[0]/vhf1-standby", func { + update_stby_vhf(0, 1); +}); + +setlistener("/systems/radio/rmp[0]/vhf2-standby", func { + update_stby_vhf(0, 2); +}); + +setlistener("/systems/radio/rmp[0]/vhf3-standby", func { + update_stby_vhf(0, 3); +}); + +setlistener("/systems/radio/rmp[1]/vhf1-standby", func { + update_stby_vhf(1, 1); +}); + +setlistener("/systems/radio/rmp[1]/vhf2-standby", func { + update_stby_vhf(1, 2); +}); + +setlistener("/systems/radio/rmp[1]/vhf3-standby", func { + update_stby_vhf(1, 3); +}); + +setlistener("/systems/radio/rmp[2]/vhf1-standby", func { + update_stby_vhf(0, 1); +}); + +setlistener("/systems/radio/rmp[2]/vhf2-standby", func { + update_stby_vhf(0, 2); +}); + +setlistener("/systems/radio/rmp[2]/vhf3-standby", func { + update_stby_vhf(0, 3); +}); + +setlistener("/instrumentation/comm[0]/frequencies/selected-mhz", func { + update_active_vhf(1); +}); + +setlistener("/instrumentation/comm[1]/frequencies/selected-mhz", func { + update_active_vhf(2); +}); + +# In case that a 3rd RMP is added, uncomment the following lines +#setlistener("/instrumentation/comm[2]/frequencies/selected-mhz", func { +# update_active_vhf(2); +#}); + +setlistener("/systems/radio/rmp[0]/sel_chan", func { + update_chan_sel(0); +}); + +setlistener("/systems/radio/rmp[1]/sel_chan", func { + update_chan_sel(1); +}); + +setlistener("/systems/radio/rmp[2]/sel_chan", func { + update_chan_sel(2); +}); diff --git a/Models/Instruments/Radio/Radio1.xml b/Models/Instruments/Radio/Radio1.xml index 2de9e13b..5cd81d79 100644 --- a/Models/Instruments/Radio/Radio1.xml +++ b/Models/Instruments/Radio/Radio1.xml @@ -1,13 +1,1518 @@ - - + + res/Radio1.ac - + + + + pick + radio_on + + + false + + property-toggle + controls/radio/rmp[0]/on + + + + + rotate + radio_on + controls/radio/rmp[0]/on + + + 0 + 20 + + + 1 + -20 + + + + radio_on.axis + + + + + + pick + radio_vhf1 + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + vhf1 + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + + pick + radio_vhf2 + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + vhf2 + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + + pick + radio_vhf3 + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + vhf3 + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + + pick + radio_hf1 + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + hf1 + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + + pick + radio_hf2 + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + hf2 + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + + pick + radio_am + + + true + + property-toggle + systems/radio/rmp[0]/am-active + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + systems/radio/rmp[0]/sel_chan + hf1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + + + + + + + + + pick + radio_exchange + + + true + + nasal + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + + + pick + radio_rot1 + + + + true + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[0]/vhf1-standby + 0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[0]/vhf2-standby + 0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[0]/vhf3-standby + 0.025 + 0.025 + 0.0 + 1.0 + true + decimal + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[0]/hf1-standby + 1 + 200 + 1800 + true + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[0]/hf2-standby + 1 + 200 + 1800 + true + + + + + + + true + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[0]/vhf1-standby + -0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[0]/vhf2-standby + -0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[0]/vhf3-standby + -0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[0]/hf1-standby + -1 + 200 + 1800 + true + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[0]/hf2-standby + -1 + 200 + 1800 + true + + + + + + pick + radio_rot0 + + + + true + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[0]/vhf1-standby + 1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[0]/vhf2-standby + 1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[0]/vhf3-standby + 1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[0]/hf1-standby + 100 + 200 + 1800 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[0]/hf2-standby + 100 + 200 + 1800 + true + integer + + + + + + + true + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[0]/vhf1-standby + -1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[0]/vhf2-standby + -1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[0]/vhf3-standby + -1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[0]/hf1-standby + -100 + 200 + 1800 + true + integer + + + + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[0]/hf2-standby + -100 + 200 + 1800 + true + integer + + + + + + + + pick + radio_nav_lit + + + + property-assign + controls/radio/rmp[0]/nav-protect + 1 + + + + property-assign + controls/radio/rmp[0]/nav-protect + 0 + + + nasal + + + + + + + rotate + radio_nav_lit + controls/radio/rmp[0]/nav-protect + -90 + + radio_nav_lit.axis + + + + + + pick + radio_nav + + + true + + property-toggle + systems/radio/rmp[0]/nav + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + controls/radio/rmp[0]/nav-protect + 1 + + + + + + + + + + pick + radio_vor + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + vor + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/nav + 1 + + + + + + + + + pick + radio_ls + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + ls + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/nav + 1 + + + + + + + + + pick + radio_adf + + + true + + property-assign + systems/radio/rmp[0]/sel_chan + adf + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/nav + 1 + + + + + + + + + pick + radio_bfo + + + true + + property-toggle + systems/radio/rmp[0]/bfo-active + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + systems/radio/rmp[0]/nav + 1 + + + systems/radio/rmp[0]/sel_chan + adf + + + + + + + + + + select + radio_sel_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + controls/radio/rmp[0]/on + 1 + + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + systems/radio/rmp[2]/sel_chan + vhf1 + + + systems/radio/rmp[2]/sel_chan + vhf2 + + + + + + + + + + select + radio_vhf1_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + vhf1 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_vhf2_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_vhf3_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_hf1_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_hf2_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_nav_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/nav + 1 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_vor_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + vor + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_ls_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + ls + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_adf_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + adf + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_bfo_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/bfo-active + 1 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + select + radio_am_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/am-active + 1 + + + controls/radio/rmp[0]/on + 1 + + + + + + + + + select + rmp1-active + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[0]/on + 1 + + + systems/electrical/bus/dc-ess + 25 + + + + + + + rmp1-active + + -0.22190 + -0.21549 + -0.12613 + 90 + + center-center + xy-plane + text-value + %s + controls/radio/rmp[0]/active-display + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + + select + rmp1-active-test + + + controls/switches/annun-test + 1 + + + + + + rmp1-active-test + + -0.22190 + -0.21549 + -0.12613 + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + + select + rmp1-standby + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[0]/on + 1 + + + systems/electrical/bus/dc-ess + 25 + + + + + + + rmp1-standby + + -0.22190 + -0.14896 + -0.12613 + 90 + + center-center + xy-plane + text-value + %s + controls/radio/rmp[0]/standby-display + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + + select + rmp1-standby-test + + + controls/switches/annun-test + 1 + + + + + + rmp1-standby-test + + -0.22190 + -0.14896 + -0.12613 + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + diff --git a/Models/Instruments/Radio/Radio2.xml b/Models/Instruments/Radio/Radio2.xml index 2de9e13b..3f8bbb6e 100644 --- a/Models/Instruments/Radio/Radio2.xml +++ b/Models/Instruments/Radio/Radio2.xml @@ -1,13 +1,1518 @@ - - + + res/Radio1.ac - + + + + pick + radio_on + + + false + + property-toggle + controls/radio/rmp[1]/on + + + + + rotate + radio_on + controls/radio/rmp[1]/on + + + 0 + 20 + + + 1 + -20 + + + + radio_on.axis + + + + + + pick + radio_vhf1 + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + vhf1 + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + + pick + radio_vhf2 + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + vhf2 + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + + pick + radio_vhf3 + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + vhf3 + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + + pick + radio_hf1 + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + hf1 + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + + pick + radio_hf2 + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + hf2 + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + + pick + radio_am + + + true + + property-toggle + systems/radio/rmp[1]/am-active + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + systems/radio/rmp[1]/sel_chan + hf1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + + + + + + + + + pick + radio_exchange + + + true + + nasal + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + + + pick + radio_rot1 + + + + true + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[1]/vhf1-standby + 0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[1]/vhf2-standby + 0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[1]/vhf3-standby + 0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[1]/hf1-standby + 1 + 200 + 1800 + true + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[1]/hf2-standby + 1 + 200 + 1800 + true + + + + + + + true + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[1]/vhf1-standby + -0.025 + 0.0 + 1.0 + 0.025 + true + decimal + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[1]/vhf2-standby + -0.025 + 0.025 + 0.0 + 1.0 + true + decimal + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[1]/vhf3-standby + -0.025 + 0.025 + 0.0 + 1.0 + true + decimal + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[1]/hf1-standby + -1 + 200 + 1800 + true + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[1]/hf2-standby + -1 + 200 + 1800 + true + + + + + + pick + radio_rot0 + + + + true + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[1]/vhf1-standby + 1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[1]/vhf2-standby + 1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[1]/vhf3-standby + 1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[1]/hf1-standby + 100 + 200 + 1800 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[1]/hf2-standby + 100 + 200 + 1800 + true + integer + + + + + + + true + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + + property-adjust + systems/radio/rmp[1]/vhf1-standby + -1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf2 + + + + property-adjust + systems/radio/rmp[1]/vhf2-standby + -1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + + property-adjust + systems/radio/rmp[1]/vhf3-standby + -1 + 118.0 + 137.0 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + + property-adjust + systems/radio/rmp[1]/hf1-standby + -100 + 200 + 1800 + true + integer + + + + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + + property-adjust + systems/radio/rmp[1]/hf2-standby + -100 + 200 + 1800 + true + integer + + + + + + + + pick + radio_nav_lit + + + + property-assign + controls/radio/rmp[1]/nav-protect + 1 + + + + property-assign + controls/radio/rmp[1]/nav-protect + 0 + + + nasal + + + + + + + rotate + radio_nav_lit + controls/radio/rmp[1]/nav-protect + -90 + + radio_nav_lit.axis + + + + + + pick + radio_nav + + + true + + property-toggle + systems/radio/rmp[1]/nav + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + controls/radio/rmp[1]/nav-protect + 1 + + + + + + + + + + pick + radio_vor + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + vor + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/nav + 1 + + + + + + + + + pick + radio_ls + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + ls + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/nav + 1 + + + + + + + + + pick + radio_adf + + + true + + property-assign + systems/radio/rmp[1]/sel_chan + adf + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/nav + 1 + + + + + + + + + pick + radio_bfo + + + true + + property-toggle + systems/radio/rmp[1]/bfo-active + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + systems/radio/rmp[1]/nav + 1 + + + systems/radio/rmp[1]/sel_chan + adf + + + + + + + + + + select + radio_sel_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + controls/radio/rmp[1]/on + 1 + + + + systems/radio/rmp[0]/sel_chan + vhf2 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + systems/radio/rmp[0]/sel_chan + hf1 + + + systems/radio/rmp[0]/sel_chan + hf2 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + systems/radio/rmp[2]/sel_chan + vhf1 + + + systems/radio/rmp[2]/sel_chan + vhf2 + + + + + + + + + + select + radio_vhf1_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + vhf1 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_vhf2_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + vhf2 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_vhf3_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_hf1_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + hf1 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_hf2_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + hf2 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_nav_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/nav + 1 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_vor_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + vor + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_ls_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + ls + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_adf_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + adf + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_bfo_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/bfo-active + 1 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + select + radio_am_led + + + + controls/switches/annun-test + 1 + + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/am-active + 1 + + + controls/radio/rmp[1]/on + 1 + + + + + + + + + select + rmp2-active + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[1]/on + 1 + + + systems/electrical/bus/dc2 + 25 + + + + + + + rmp2-active + + -0.22190 + -0.21549 + -0.12613 + 90 + + center-center + xy-plane + text-value + %s + controls/radio/rmp[1]/active-display + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + + select + rmp2-active-test + + + controls/switches/annun-test + 1 + + + + + + rmp2-active-test + + -0.22190 + -0.21549 + -0.12613 + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + + select + rmp2-standby + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[1]/on + 1 + + + systems/electrical/bus/dc2 + 25 + + + + + + + rmp2-standby + + -0.22190 + -0.14896 + -0.12613 + 90 + + center-center + xy-plane + text-value + %s + controls/radio/rmp[1]/standby-display + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + + + + select + rmp2-standby-test + + + controls/switches/annun-test + 1 + + + + + + rmp2-standby-test + + -0.22190 + -0.14896 + -0.12613 + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index af8df7e6..a7669e9f 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -193,6 +193,7 @@ var systemsInit = func { libraries.ECAM.init(); libraries.BUTTONS.init(); libraries.variousReset(); + rmp.init(); } setlistener("/sim/signals/fdm-initialized", func {