1
0
Fork 0

Audio switching

This commit is contained in:
Jonathan Redpath 2022-02-17 18:28:30 +00:00
parent d2f6c4098e
commit 809de2c3a1
4 changed files with 167 additions and 66 deletions

View file

@ -1115,6 +1115,7 @@
</lights> </lights>
</adirscp> </adirscp>
<switching> <switching>
<audio type="int">0</audio>
<att-hdg type="int">0</att-hdg> <att-hdg type="int">0</att-hdg>
<air-data type="int">0</air-data> <air-data type="int">0</air-data>
</switching> </switching>

View file

@ -210,19 +210,9 @@
<type>rotate</type> <type>rotate</type>
<property>instrumentation/ddrmi/flag-hdg</property> <property>instrumentation/ddrmi/flag-hdg</property>
<offset-deg>-180</offset-deg> <offset-deg>-180</offset-deg>
<factor>-180</factor> <factor>180</factor>
<!--<axis>
<object-name>ddrmi_hdg_flag.axis</object-name>
</axis>-->
<center>
<x-m>-0.530373</x-m>
<y-m>-0.142459</y-m>
<z-m>0.131096</z-m>
</center>
<axis> <axis>
<x>1</x> <object-name>ddrmi_hdg_flag.axis</object-name>
<y>0</y>
<z>0.2</z>
</axis> </axis>
</animation> </animation>
@ -1196,8 +1186,10 @@
<object-name>dec_low_on</object-name> <object-name>dec_low_on</object-name>
<object-name>dec_med_on</object-name> <object-name>dec_med_on</object-name>
<object-name>dec_max_on</object-name> <object-name>dec_max_on</object-name>
<object-name>gpws_gs_sw_gpws_on</object-name> <object-name>gpws_gs_sw_gpws_on.cpt</object-name>
<object-name>gpws_gs_sw_gs_on</object-name> <object-name>gpws_gs_sw_gs_on.cpt</object-name>
<object-name>gpws_gs_sw_gpws_on.fo</object-name>
<object-name>gpws_gs_sw_gs_on.fo</object-name>
<object-name>prio_capt.arrow</object-name> <object-name>prio_capt.arrow</object-name>
<object-name>prio_capt.arrow.001</object-name> <object-name>prio_capt.arrow.001</object-name>
<object-name>prio_capt.capt</object-name> <object-name>prio_capt.capt</object-name>
@ -2598,17 +2590,10 @@
<object-name>foot_warmer_cpt_sw</object-name> <object-name>foot_warmer_cpt_sw</object-name>
<object-name>foot_warmer_cpt_sw.mark</object-name> <object-name>foot_warmer_cpt_sw.mark</object-name>
<property>controls/cabin/footwarmer-cpt-pos</property> <property>controls/cabin/footwarmer-cpt-pos</property>
<offset-deg>30</offset-deg> <offset-deg>-30</offset-deg>
<factor>-60</factor> <factor>60</factor>
<center>
<x-m>-0.559529</x-m>
<y-m>-0.681048</y-m>
<z-m>0.232538</z-m>
</center>
<axis> <axis>
<x>0</x> <object-name>foot_warmer_cpt_sw.axis</object-name>
<y>1</y>
<z>0</z>
</axis> </axis>
<action> <action>
<repeatable>false</repeatable> <repeatable>false</repeatable>
@ -2638,17 +2623,10 @@
<object-name>foot_warmer_fo_sw</object-name> <object-name>foot_warmer_fo_sw</object-name>
<object-name>foot_warmer_fo_sw.mark</object-name> <object-name>foot_warmer_fo_sw.mark</object-name>
<property>controls/cabin/footwarmer-fo-pos</property> <property>controls/cabin/footwarmer-fo-pos</property>
<offset-deg>30</offset-deg> <offset-deg>-30</offset-deg>
<factor>-60</factor> <factor>60</factor>
<center>
<x-m>-0.559529</x-m>
<y-m>0.679987</y-m>
<z-m>0.232538</z-m>
</center>
<axis> <axis>
<x>0</x> <object-name>foot_warmer_fo_sw.001</object-name>
<y>1</y>
<z>0</z>
</axis> </axis>
<action> <action>
<repeatable>false</repeatable> <repeatable>false</repeatable>
@ -2675,7 +2653,8 @@
<animation> <animation>
<type>select</type> <type>select</type>
<object-name>gpws_gs_sw_gpws_on</object-name> <object-name>gpws_gs_sw_gpws_on.cpt</object-name>
<object-name>gpws_gs_sw_gpws_on.fo</object-name>
<condition> <condition>
<or> <or>
<property>controls/switches/annun-test</property> <property>controls/switches/annun-test</property>
@ -2686,7 +2665,8 @@
<animation> <animation>
<type>select</type> <type>select</type>
<object-name>gpws_gs_sw_gs_on</object-name> <object-name>gpws_gs_sw_gs_on.cpt</object-name>
<object-name>gpws_gs_sw_gs_on.fo</object-name>
<condition> <condition>
<or> <or>
<property>controls/switches/annun-test</property> <property>controls/switches/annun-test</property>
@ -2697,9 +2677,9 @@
<animation> <animation>
<type>pick</type> <type>pick</type>
<object-name>gpws_gs_sw</object-name> <object-name>gpws_gs_sw.cpt</object-name>
<object-name>gpws_gs_sw_gs_on</object-name> <object-name>gpws_gs_sw_gs_on.cpt</object-name>
<object-name>gpws_gs_sw_gpws_on</object-name> <object-name>gpws_gs_sw_gpws_on.cpt</object-name>
<action> <action>
<button>0</button> <button>0</button>
<binding> <binding>
@ -2764,11 +2744,80 @@
</hovered> </hovered>
</animation> </animation>
<animation>
<type>pick</type>
<object-name>gpws_gs_sw.fo</object-name>
<object-name>gpws_gs_sw_gs_on.fo</object-name>
<object-name>gpws_gs_sw_gpws_on.fo</object-name>
<action>
<button>0</button>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/ac-1</property>
<value>110</value>
</greater-than-equals>
</and>
</condition>
<command>property-assign</command>
<property>/instrumentation/mk-viii/inputs/discretes/self-test</property>
<value>1</value>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/ac-1</property>
<value>110</value>
</greater-than-equals>
</and>
</condition>
<command>property-assign</command>
<property>/instrumentation/mk-viii/inputs/discretes/glideslope-cancel</property>
<value>1</value>
</binding>
<binding>
<command>nasal</command>
<script>libraries.pushbutton();</script>
</binding>
<binding>
<command>property-assign</command>
<property>/controls/cockpit/gpws_r-translate</property>
<value>0.00075</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>/instrumentation/mk-viii/inputs/discretes/self-test</property>
<value>0</value>
</binding>
<binding>
<command>property-assign</command>
<property>/instrumentation/mk-viii/inputs/discretes/glideslope-cancel</property>
<value>0</value>
</binding>
<binding>
<command>property-assign</command>
<property>/controls/cockpit/gpws_r-translate</property>
<value>0.0</value>
</binding>
</mod-up>
</action>
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>gpws-lbl</tooltip-id>
<label>Cancel glideslope warning or self test GPWS</label>
</binding>
</hovered>
</animation>
<animation> <animation>
<type>translate</type> <type>translate</type>
<object-name>gpws_gs_sw</object-name> <object-name>gpws_gs_sw.cpt</object-name>
<object-name>gpws_gs_sw_gs_on</object-name> <object-name>gpws_gs_sw_gs_on.cpt</object-name>
<object-name>gpws_gs_sw_gpws_on</object-name> <object-name>gpws_gs_sw_gpws_on.cpt</object-name>
<property>/controls/cockpit/gpws_l-translate</property> <property>/controls/cockpit/gpws_l-translate</property>
<axis> <axis>
<x1-m>-0.366265</x1-m> <x1-m>-0.366265</x1-m>
@ -2780,6 +2829,22 @@
</axis> </axis>
</animation> </animation>
<animation>
<type>translate</type>
<object-name>gpws_gs_sw.fo</object-name>
<object-name>gpws_gs_sw_gs_on.fo</object-name>
<object-name>gpws_gs_sw_gpws_on.fo</object-name>
<property>/controls/cockpit/gpws_r-translate</property>
<axis>
<x1-m>-0.366265</x1-m>
<y1-m>0.39799</y1-m>
<z1-m>0.481225</z1-m>
<x2-m>-0.375885</x2-m>
<y2-m>0.39799</y2-m>
<z2-m>0.478435</z2-m>
</axis>
</animation>
<animation> <animation>
<type>select</type> <type>select</type>
<object-name>atc_msg_on</object-name> <object-name>atc_msg_on</object-name>
@ -11685,15 +11750,10 @@
<type>knob</type> <type>knob</type>
<object-name>light_console_cpt_sw</object-name> <object-name>light_console_cpt_sw</object-name>
<property>/controls/lighting/console-floor-light-sw-pos</property> <property>/controls/lighting/console-floor-light-sw-pos</property>
<factor>-60</factor> <offset-deg>-30</offset-deg>
<offset-deg>30</offset-deg> <factor>60</factor>
<center>
<x-m>-0.560268</x-m>
<y-m>-0.713513</y-m>
<z-m>0.232654</z-m>
</center>
<axis> <axis>
<y>1</y> <object-name>light_console_cpt_sw.axis</object-name>
</axis> </axis>
<action> <action>
<binding> <binding>
@ -11890,15 +11950,10 @@
<type>knob</type> <type>knob</type>
<object-name>light_console_fo_sw</object-name> <object-name>light_console_fo_sw</object-name>
<property>/controls/lighting/console-floor-light-sw-right-pos</property> <property>/controls/lighting/console-floor-light-sw-right-pos</property>
<factor>-60</factor> <offset-deg>-30</offset-deg>
<offset-deg>30</offset-deg> <factor>60</factor>
<center>
<x-m>-0.560268</x-m>
<y-m>-0.713513</y-m>
<z-m>0.232654</z-m>
</center>
<axis> <axis>
<y>1</y> <object-name>light_console_fo_sw.axis</object-name>
</axis> </axis>
<action> <action>
<binding> <binding>
@ -12176,5 +12231,38 @@
</hovered> </hovered>
</animation> </animation>
<animation>
<type>knob</type>
<object-name>audio_swtg</object-name>
<object-name>eng_mode.mark.030</object-name>
<property>controls/navigation/switching/audio-pos</property>
<factor>-70</factor>
<offset-deg>35</offset-deg>
<axis>
<object-name>eng_mode.axis.025</object-name>
</axis>
<action>
<binding>
<command>property-cycle</command>
<property>controls/navigation/switching/audio</property>
<value>-1</value>
<value>0</value>
<value>1</value>
<wrap>false</wrap>
</binding>
<binding>
<command>nasal</command>
<script>setprop("sim/sounde/knb1", 1);</script>
</binding>
</action>
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>audio-swtg-lbl</tooltip-id>
<label>Switch audio control to ACP3</label>
</binding>
</hovered>
</animation>
</PropertyList> </PropertyList>

View file

@ -5,8 +5,9 @@
var SwitchingPanel = { var SwitchingPanel = {
Switches: { Switches: {
attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"), audio: props.globals.getNode("/controls/navigation/switching/audio"),
airData: props.globals.getNode("/controls/navigation/switching/air-data"), airData: props.globals.getNode("/controls/navigation/switching/air-data"),
attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"),
eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"), eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"),
}, },

View file

@ -154,16 +154,27 @@
<channel name="Loudspeakers"> <channel name="Loudspeakers">
<!-- TODO audio switching -->
<switch name="Loudspeaker"> <switch name="Loudspeaker">
<default value="0"/> <default value="0"/>
<test logic="AND" value ="/controls/switches/loudspeaker-l"> <test logic="OR" value ="/controls/switches/loudspeaker-l">
/controls/switches/loudspeaker-l ge /controls/switches/loudspeaker-r <test logic="AND">
/systems/electrical/bus/dc-ess ge 25 /systems/electrical/bus/dc-ess ge 25
/controls/switches/loudspeaker-l ge /controls/switches/loudspeaker-r
</test>
<test logic="AND">
/systems/electrical/bus/dc-1 ge 25
/controls/navigation/switching/audio eq -1
</test>
</test> </test>
<test logic="AND" value ="/controls/switches/loudspeaker-r"> <test logic="AND" value ="/controls/switches/loudspeaker-r">
/controls/switches/loudspeaker-r gt /controls/switches/loudspeaker-l <test logic="AND">
/systems/electrical/bus/dc-ess ge 25 /systems/electrical/bus/dc-ess ge 25
/controls/switches/loudspeaker-r gt /controls/switches/loudspeaker-r
</test>
<test logic="AND">
/systems/electrical/bus/dc-1 ge 25
/controls/navigation/switching/audio eq 1
</test>
</test> </test>
<output>/sim/sound/atc/volume</output> <output>/sim/sound/atc/volume</output>
<output>/sim/sound/chatter/volume</output> <output>/sim/sound/chatter/volume</output>