From cafa1d6001572e185a089978ec1eab52000d5b0c Mon Sep 17 00:00:00 2001 From: merspieler Date: Wed, 26 Sep 2018 20:42:57 +0200 Subject: [PATCH 1/7] 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 { From be5aee8fef074ab11d9569166d18cdfffe7c6cd6 Mon Sep 17 00:00:00 2001 From: merspieler Date: Wed, 26 Sep 2018 20:53:06 +0200 Subject: [PATCH 2/7] Change to comply with coding conventions Signed-off-by: merspieler --- Models/Instruments/Radio/Radio1.xml | 84 ++++++++++++++--------------- Models/Instruments/Radio/Radio2.xml | 84 ++++++++++++++--------------- 2 files changed, 84 insertions(+), 84 deletions(-) diff --git a/Models/Instruments/Radio/Radio1.xml b/Models/Instruments/Radio/Radio1.xml index 5cd81d79..c37b849b 100644 --- a/Models/Instruments/Radio/Radio1.xml +++ b/Models/Instruments/Radio/Radio1.xml @@ -1407,30 +1407,30 @@ - - rmp1-active-test - + + 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 - - + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + @@ -1491,28 +1491,28 @@ - - rmp1-standby-test - + + 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 - - + 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 3f8bbb6e..35937793 100644 --- a/Models/Instruments/Radio/Radio2.xml +++ b/Models/Instruments/Radio/Radio2.xml @@ -1407,30 +1407,30 @@ - - rmp2-active-test - + + 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 - - + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + @@ -1491,28 +1491,28 @@ - - rmp2-standby-test - + + 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 - - + 90 + + center-center + xy-plane + text-value + 888.888 + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + From 8f47d3c037e09284b2692f11343ef58f7f1301fd Mon Sep 17 00:00:00 2001 From: merspieler Date: Thu, 27 Sep 2018 16:28:18 +0200 Subject: [PATCH 3/7] Added VHF3 to the RMPs and fixed a few issues Signed-off-by: merspieler --- Models/Instruments/Radio/Radio.nas | 47 ++++----- Models/Instruments/Radio/Radio1.xml | 158 ++++++++++++++++++++++++++++ Models/Instruments/Radio/Radio2.xml | 158 ++++++++++++++++++++++++++++ Systems/instrumentation.xml | 5 + 4 files changed, 340 insertions(+), 28 deletions(-) diff --git a/Models/Instruments/Radio/Radio.nas b/Models/Instruments/Radio/Radio.nas index bf77e446..b406a0ff 100644 --- a/Models/Instruments/Radio/Radio.nas +++ b/Models/Instruments/Radio/Radio.nas @@ -9,10 +9,9 @@ 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_vhf1 = props.globals.getNode("/instrumentation/comm[0]/frequencies/selected-mhz"); +var act_vhf2 = props.globals.getNode("/instrumentation/comm[1]/frequencies/selected-mhz"); +var act_vhf3 = props.globals.initNode("/instrumentation/comm[2]/frequencies/selected-mhz", 0); 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"); @@ -76,17 +75,16 @@ var update_active_vhf = func(vhf) { } } } 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); -# } -# } + if(sel1 == "vhf3" or sel2 == "vhf3") { + var act = sprintf("%3.3f", act_vhf3.getValue()); + + if(sel1 == "vhf3") { + act_display_rmp1.setValue(act); + } + if(sel2 == "vhf3") { + act_display_rmp2.setValue(act); + } + } } }; @@ -159,19 +157,13 @@ var transfer = func(rmp_no) { 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); }); @@ -197,15 +189,15 @@ setlistener("/systems/radio/rmp[1]/vhf3-standby", func { }); setlistener("/systems/radio/rmp[2]/vhf1-standby", func { - update_stby_vhf(0, 1); + update_stby_vhf(2, 1); }); setlistener("/systems/radio/rmp[2]/vhf2-standby", func { - update_stby_vhf(0, 2); + update_stby_vhf(2, 2); }); setlistener("/systems/radio/rmp[2]/vhf3-standby", func { - update_stby_vhf(0, 3); + update_stby_vhf(2, 3); }); setlistener("/instrumentation/comm[0]/frequencies/selected-mhz", func { @@ -216,10 +208,9 @@ 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("/instrumentation/comm[2]/frequencies/selected-mhz", func { + update_active_vhf(3); +}); setlistener("/systems/radio/rmp[0]/sel_chan", func { update_chan_sel(0); diff --git a/Models/Instruments/Radio/Radio1.xml b/Models/Instruments/Radio/Radio1.xml index c37b849b..458f30bb 100644 --- a/Models/Instruments/Radio/Radio1.xml +++ b/Models/Instruments/Radio/Radio1.xml @@ -318,6 +318,12 @@ systems/radio/rmp[0]/sel_chan vhf3 + + + systems/radio/rmp[0]/vhf3-standby + 0 + + property-adjust @@ -455,6 +461,12 @@ systems/radio/rmp[0]/sel_chan vhf3 + + + systems/radio/rmp[0]/vhf3-standby + 0 + + property-adjust @@ -594,6 +606,12 @@ systems/radio/rmp[0]/sel_chan vhf3 + + + systems/radio/rmp[0]/vhf3-standby + 0 + + property-adjust @@ -730,6 +748,12 @@ systems/radio/rmp[0]/sel_chan vhf3 + + + systems/radio/rmp[0]/vhf3-standby + 0 + + property-adjust @@ -1366,6 +1390,18 @@ systems/electrical/bus/dc-ess 25 + + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + instrumentation/comm[2]/frequencies/selected-mhz + 0 + + + @@ -1395,6 +1431,61 @@ + + + select + rmp1-active-vhf3-data + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[0]/on + 1 + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + instrumentation/comm[2]/frequencies/selected-mhz + 0 + + + + + + + rmp1-active-vhf3-data + + -0.22190 + -0.21549 + -0.12613 + 90 + + center-center + xy-plane + text-value + data + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + select @@ -1450,6 +1541,18 @@ systems/electrical/bus/dc-ess 25 + + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + systems/radio/rmp[0]/vhf3-standby + 0 + + + @@ -1479,6 +1582,61 @@ + + + select + rmp1-standby-vhf3-data + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[0]/on + 1 + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[0]/sel_chan + vhf3 + + + systems/radio/rmp[0]/vhf3-standby + 0 + + + + + + + rmp1-standby-vhf3-data + + -0.22190 + -0.14896 + -0.12613 + 90 + + center-center + xy-plane + text-value + data + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + select diff --git a/Models/Instruments/Radio/Radio2.xml b/Models/Instruments/Radio/Radio2.xml index 35937793..83b3a6eb 100644 --- a/Models/Instruments/Radio/Radio2.xml +++ b/Models/Instruments/Radio/Radio2.xml @@ -318,6 +318,12 @@ systems/radio/rmp[1]/sel_chan vhf3 + + + systems/radio/rmp[1]/vhf3-standby + 0 + + property-adjust @@ -455,6 +461,12 @@ systems/radio/rmp[1]/sel_chan vhf3 + + + systems/radio/rmp[1]/vhf3-standby + 0 + + property-adjust @@ -594,6 +606,12 @@ systems/radio/rmp[1]/sel_chan vhf3 + + + systems/radio/rmp[1]/vhf3-standby + 0 + + property-adjust @@ -730,6 +748,12 @@ systems/radio/rmp[1]/sel_chan vhf3 + + + systems/radio/rmp[1]/vhf3-standby + 0 + + property-adjust @@ -1366,6 +1390,18 @@ systems/electrical/bus/dc2 25 + + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + instrumentation/comm[2]/frequencies/selected-mhz + 0 + + + @@ -1395,6 +1431,61 @@ + + + select + rmp2-active-vhf3-data + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[1]/on + 1 + + + systems/electrical/bus/dc2 + 25 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + instrumentation/comm[2]/frequencies/selected-mhz + 0 + + + + + + + rmp2-active-vhf3-data + + -0.22190 + -0.21549 + -0.12613 + 90 + + center-center + xy-plane + text-value + data + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + select @@ -1450,6 +1541,18 @@ systems/electrical/bus/dc2 25 + + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + systems/radio/rmp[1]/vhf3-standby + 0 + + + @@ -1479,6 +1582,61 @@ + + + select + rmp2-standby-vhf3-data + + + + controls/switches/annun-test + 1 + + + controls/radio/rmp[1]/on + 1 + + + systems/electrical/bus/dc-ess + 25 + + + systems/radio/rmp[1]/sel_chan + vhf3 + + + systems/radio/rmp[1]/vhf3-standby + 0 + + + + + + + rmp2-standby-vhf3-data + + -0.22190 + -0.14896 + -0.12613 + 90 + + center-center + xy-plane + text-value + data + autopilot/servicable + false + led.txf + true + false + false + 0.008 + + 32 + 32 + + + select diff --git a/Systems/instrumentation.xml b/Systems/instrumentation.xml index afb049ac..e0b34054 100644 --- a/Systems/instrumentation.xml +++ b/Systems/instrumentation.xml @@ -76,6 +76,11 @@ file, these values will be used (they are hardcoded). 1 + + comm + 2 + + dme 0 From 8f498b1819a33f8816bef8526bd3beb204ed156b Mon Sep 17 00:00:00 2001 From: merspieler Date: Thu, 27 Sep 2018 16:32:44 +0200 Subject: [PATCH 4/7] Fixed, RMP2 part beeing on DC-ESS Signed-off-by: merspieler --- Models/Instruments/Radio/Radio2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Models/Instruments/Radio/Radio2.xml b/Models/Instruments/Radio/Radio2.xml index 83b3a6eb..f38896da 100644 --- a/Models/Instruments/Radio/Radio2.xml +++ b/Models/Instruments/Radio/Radio2.xml @@ -1597,7 +1597,7 @@ 1 - systems/electrical/bus/dc-ess + systems/electrical/bus/dc2 25 From 16b7853f74ea388886209f6c49e31d2b98466054 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Thu, 27 Sep 2018 13:44:25 -0400 Subject: [PATCH 5/7] Sim: Add support for VHF3 --- A320-main.xml | 29 ++++++++++++++++++++- Systems/instrumentation.xml | 50 +++++++++++++++++++++---------------- 2 files changed, 56 insertions(+), 23 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index 1c6f4db3..a0197605 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -760,7 +760,34 @@ - + + + + 118.7 + 121.4 + + true + 0.6 + + + + + 119.4 + 122.6 + + true + 0.6 + + + + + 120.1 + 123.2 + + true + 0.6 + + 111.15 diff --git a/Systems/instrumentation.xml b/Systems/instrumentation.xml index afb049ac..7f415277 100644 --- a/Systems/instrumentation.xml +++ b/Systems/instrumentation.xml @@ -30,23 +30,24 @@ file, these values will be used (they are hardcoded). --> - + adf 0 + adf 1 - + airspeed-indicator 0 /systems/pitot/total-pressure-inhg /systems/static/pressure-inhg - + altimeter 0 @@ -54,13 +55,13 @@ file, these values will be used (they are hardcoded). 0 0 - + attitude-indicator 0 /systems/vacuum/suction-inhg - + clock 0 @@ -70,12 +71,17 @@ file, these values will be used (they are hardcoded). comm 0 - + comm 1 - + + + comm + 2 + + dme 0 @@ -103,33 +109,33 @@ file, these values will be used (they are hardcoded). 10 0.1 - + marker-beacon 0 - + heading-indicator 0 /systems/vacuum/suction-inhg - + kt-70 0 - + magnetic-compass 0 - + nav 0 - + nav 1 @@ -144,49 +150,49 @@ file, these values will be used (they are hardcoded). nav 3 - + slip-skid-ball 0 - + transponder 0 /instrumentation/encoder/mode-c-alt-ft - + turn-indicator 0 - + vertical-speed-indicator 0 /systems/static/pressure-inhg - + gps 0 - + tcas 0 - + wxradar 0 - + tacan 0 - + mk-viii 0 From 8201bc3dc3e8ad2d7046f7319531647684eb6fa1 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Thu, 27 Sep 2018 14:22:02 -0400 Subject: [PATCH 6/7] System: Integrate radios properly into acconfig, and some fixes --- AircraftConfig/acconfig.nas | 6 ++ Models/Instruments/Radio/Radio1.xml | 86 ++++++++++++++++++++--------- Models/Instruments/Radio/Radio2.xml | 86 ++++++++++++++++++++--------- Nasal/rmp.nas | 51 ++++++++++------- revision.txt | 2 +- 5 files changed, 156 insertions(+), 75 deletions(-) diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index d829028f..46082679 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -307,6 +307,9 @@ var beforestart_b = func { setprop("/controls/adirs/mcducbtn", 1); setprop("/controls/lighting/beacon", 1); setprop("/controls/lighting/nav-lights-switch", 1); + setprop("/controls/radio/rmp[0]/on", 1); + setprop("/controls/radio/rmp[1]/on", 1); + setprop("/controls/radio/rmp[2]/on", 1); setprop("/controls/gear/brake-left", 0); setprop("/controls/gear/brake-right", 0); setprop("/systems/acconfig/autoconfig-running", 0); @@ -381,6 +384,9 @@ var taxi_b = func { setprop("/controls/adirs/mcducbtn", 1); setprop("/controls/lighting/beacon", 1); setprop("/controls/lighting/nav-lights-switch", 1); + setprop("/controls/radio/rmp[0]/on", 1); + setprop("/controls/radio/rmp[1]/on", 1); + setprop("/controls/radio/rmp[2]/on", 1); settimer(taxi_c, 2); } var taxi_c = func { diff --git a/Models/Instruments/Radio/Radio1.xml b/Models/Instruments/Radio/Radio1.xml index 458f30bb..ec837e9d 100644 --- a/Models/Instruments/Radio/Radio1.xml +++ b/Models/Instruments/Radio/Radio1.xml @@ -1375,7 +1375,7 @@ select - rmp1-active + rmp-active @@ -1407,11 +1407,11 @@ - rmp1-active + rmp-active - -0.22190 - -0.21549 - -0.12613 + -0.22205 + -0.21625 + -0.12582 90 center-center @@ -1434,7 +1434,7 @@ select - rmp1-active-vhf3-data + rmp-active-vhf3-data @@ -1462,11 +1462,11 @@ - rmp1-active-vhf3-data + rmp-active-vhf3-data - -0.22190 - -0.21549 - -0.12613 + -0.22205 + -0.21625 + -0.12582 90 center-center @@ -1489,7 +1489,7 @@ select - rmp1-active-test + rmp-active-test controls/switches/annun-test @@ -1499,11 +1499,11 @@ - rmp1-active-test + rmp-active-test - -0.22190 - -0.21549 - -0.12613 + -0.22205 + -0.21625 + -0.12582 90 center-center @@ -1526,7 +1526,7 @@ select - rmp1-standby + rmp-standby @@ -1558,11 +1558,11 @@ - rmp1-standby + rmp-standby - -0.22190 + -0.22205 -0.14896 - -0.12613 + -0.12582 90 center-center @@ -1585,7 +1585,7 @@ select - rmp1-standby-vhf3-data + rmp-standby-vhf3-data @@ -1613,11 +1613,11 @@ - rmp1-standby-vhf3-data + rmp-standby-vhf3-data - -0.22190 + -0.22205 -0.14896 - -0.12613 + -0.12582 90 center-center @@ -1640,7 +1640,7 @@ select - rmp1-standby-test + rmp-standby-test controls/switches/annun-test @@ -1650,11 +1650,11 @@ - rmp1-standby-test + rmp-standby-test - -0.22190 + -0.22205 -0.14896 - -0.12613 + -0.12582 90 center-center @@ -1673,4 +1673,36 @@ 32 + + + + material + rmp-active + rmp-active-test + rmp-active-vhf3-data + rmp-standby + rmp-standby-test + rmp-standby-vhf3-data + + 0.89 + 0.37 + 0.08 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 0.89 + 0.37 + 0.08 + + + diff --git a/Models/Instruments/Radio/Radio2.xml b/Models/Instruments/Radio/Radio2.xml index f38896da..d992affd 100644 --- a/Models/Instruments/Radio/Radio2.xml +++ b/Models/Instruments/Radio/Radio2.xml @@ -1375,7 +1375,7 @@ select - rmp2-active + rmp-active @@ -1407,11 +1407,11 @@ - rmp2-active + rmp-active - -0.22190 - -0.21549 - -0.12613 + -0.22205 + -0.21625 + -0.12582 90 center-center @@ -1434,7 +1434,7 @@ select - rmp2-active-vhf3-data + rmp-active-vhf3-data @@ -1462,11 +1462,11 @@ - rmp2-active-vhf3-data + rmp-active-vhf3-data - -0.22190 - -0.21549 - -0.12613 + -0.22205 + -0.21625 + -0.12582 90 center-center @@ -1489,7 +1489,7 @@ select - rmp2-active-test + rmp-active-test controls/switches/annun-test @@ -1499,11 +1499,11 @@ - rmp2-active-test + rmp-active-test - -0.22190 - -0.21549 - -0.12613 + -0.22205 + -0.21625 + -0.12582 90 center-center @@ -1526,7 +1526,7 @@ select - rmp2-standby + rmp-standby @@ -1558,11 +1558,11 @@ - rmp2-standby + rmp-standby - -0.22190 + -0.22205 -0.14896 - -0.12613 + -0.12582 90 center-center @@ -1585,7 +1585,7 @@ select - rmp2-standby-vhf3-data + rmp-standby-vhf3-data @@ -1613,11 +1613,11 @@ - rmp2-standby-vhf3-data + rmp-standby-vhf3-data - -0.22190 + -0.22205 -0.14896 - -0.12613 + -0.12582 90 center-center @@ -1640,7 +1640,7 @@ select - rmp2-standby-test + rmp-standby-test controls/switches/annun-test @@ -1650,11 +1650,11 @@ - rmp2-standby-test + rmp-standby-test - -0.22190 + -0.22205 -0.14896 - -0.12613 + -0.12582 90 center-center @@ -1673,4 +1673,36 @@ 32 + + + + material + rmp-active + rmp-active-test + rmp-active-vhf3-data + rmp-standby + rmp-standby-test + rmp-standby-vhf3-data + + 0.89 + 0.37 + 0.08 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 0.89 + 0.37 + 0.08 + + + diff --git a/Nasal/rmp.nas b/Nasal/rmp.nas index 84c5843f..6d7aae88 100644 --- a/Nasal/rmp.nas +++ b/Nasal/rmp.nas @@ -11,36 +11,47 @@ var rmp_update = nil; var act_vhf1 = props.globals.getNode("/instrumentation/comm[0]/frequencies/selected-mhz"); var act_vhf2 = props.globals.getNode("/instrumentation/comm[1]/frequencies/selected-mhz"); -var act_vhf3 = props.globals.initNode("/instrumentation/comm[2]/frequencies/selected-mhz", 0); +var act_vhf3 = props.globals.getNode("/instrumentation/comm[2]/frequencies/selected-mhz"); -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_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/active-display", "123.900", "STRING"); +var stby_display_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/standby-display", "118.700", "STRING"); +var stby_rmp1_vhf1 = props.globals.initNode("/systems/radio/rmp[0]/vhf1-standby", 118.7, "DOUBLE"); +var stby_rmp1_vhf2 = props.globals.initNode("/systems/radio/rmp[0]/vhf2-standby", 123.12, "DOUBLE"); +var stby_rmp1_vhf3 = props.globals.initNode("/systems/radio/rmp[0]/vhf3-standby", 121.5, "DOUBLE"); -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_rmp2 = props.globals.initNode("/controls/radio/rmp[1]/active-display", "127.900", "STRING"); +var stby_display_rmp2 = props.globals.initNode("/controls/radio/rmp[1]/standby-display", "123.125", "STRING"); +var stby_rmp2_vhf1 = props.globals.initNode("/systems/radio/rmp[1]/vhf1-standby", 118.7, "DOUBLE"); +var stby_rmp2_vhf2 = props.globals.initNode("/systems/radio/rmp[1]/vhf2-standby", 123.12, "DOUBLE"); +var stby_rmp2_vhf3 = props.globals.initNode("/systems/radio/rmp[1]/vhf3-standby", 121.5, "DOUBLE"); -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 act_display_rmp3 = props.globals.initNode("/controls/radio/rmp[2]/active-display", "127.900", "STRING"); +var stby_display_rmp3 = props.globals.initNode("/controls/radio/rmp[2]/standby-display", "123.125", "STRING"); +var stby_rmp3_vhf1 = props.globals.initNode("/systems/radio/rmp[2]/vhf1-standby", 118.7, "DOUBLE"); +var stby_rmp3_vhf2 = props.globals.initNode("/systems/radio/rmp[2]/vhf2-standby", 123.12, "DOUBLE"); +var stby_rmp3_vhf3 = props.globals.initNode("/systems/radio/rmp[2]/vhf3-standby", 121.5, "DOUBLE"); -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 chan_rmp1 = props.globals.initNode("/systems/radio/rmp[0]/sel_chan", "vhf1", "STRING"); +var chan_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/sel_chan", "vhf2", "STRING"); +var chan_rmp3 = props.globals.initNode("/systems/radio/rmp[2]/sel_chan", "vhf3", "STRING"); + +var pwr_sw_rmp1 = props.globals.initNode("/controls/radio/rmp[0]/on", 0, "BOOL"); +var pwr_sw_rmp2 = props.globals.initNode("/controls/radio/rmp[1]/on", 0, "BOOL"); +var pwr_sw_rmp3 = props.globals.initNode("/controls/radio/rmp[2]/on", 0, "BOOL"); 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); } - + + chan_rmp1.setValue("vhf1"); + chan_rmp2.setValue("vhf2"); + chan_rmp3.setValue("vhf3"); + pwr_sw_rmp1.setBoolValue(0); + pwr_sw_rmp2.setBoolValue(0); + pwr_sw_rmp3.setBoolValue(0); + var rmp_update = maketimer(0.2, func { rmp_refresh.update(); }); diff --git a/revision.txt b/revision.txt index 7dd297b9..2d207ed8 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4652 \ No newline at end of file +4653 \ No newline at end of file From 33e8b4350dd8936fe6401730a472e6ba80bc0cb5 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Thu, 27 Sep 2018 14:28:51 -0400 Subject: [PATCH 7/7] System: Fix radio VHF3 initial frequency for datalink --- A320-main.xml | 2 +- revision.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/A320-main.xml b/A320-main.xml index c902e9ca..64f507ef 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -781,7 +781,7 @@ - 120.1 + 0 123.2 true diff --git a/revision.txt b/revision.txt index 2d207ed8..d757c6b8 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4653 \ No newline at end of file +4654 \ No newline at end of file