Merge pull request #54 from merspieler/acp-master
Added animation and a bit of functionality to the ACP
This commit is contained in:
commit
ca5733c4da
6 changed files with 2884 additions and 14 deletions
|
@ -1549,6 +1549,9 @@
|
||||||
<rmp>
|
<rmp>
|
||||||
<file>Aircraft/IDG-A32X/Nasal/rmp.nas</file>
|
<file>Aircraft/IDG-A32X/Nasal/rmp.nas</file>
|
||||||
</rmp>
|
</rmp>
|
||||||
|
<acp>
|
||||||
|
<file>Aircraft/IDG-A32X/Nasal/acp.nas</file>
|
||||||
|
</acp>
|
||||||
</nasal>
|
</nasal>
|
||||||
|
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -452,21 +452,13 @@
|
||||||
<animation>
|
<animation>
|
||||||
<type>select</type>
|
<type>select</type>
|
||||||
<object-name>alt-text-test</object-name>
|
<object-name>alt-text-test</object-name>
|
||||||
<object-name>audio_att_led</object-name>
|
|
||||||
<object-name>audio_att_sgn</object-name>
|
<object-name>audio_att_sgn</object-name>
|
||||||
<object-name>audio_call_hf2_led</object-name>
|
<object-name>audio_call_hf2_led</object-name>
|
||||||
<object-name>audio_call_hf1_led</object-name>
|
<object-name>audio_call_hf1_led</object-name>
|
||||||
<object-name>audio_call_vhf1_led</object-name>
|
<object-name>audio_call_vhf1_led</object-name>
|
||||||
<object-name>audio_call_vhf2_led</object-name>
|
<object-name>audio_call_vhf2_led</object-name>
|
||||||
<object-name>audio_call_vhf3_led</object-name>
|
<object-name>audio_call_vhf3_led</object-name>
|
||||||
<object-name>audio_hf1_led</object-name>
|
|
||||||
<object-name>audio_hf2_led</object-name>
|
|
||||||
<object-name>audio_mech_led</object-name>
|
|
||||||
<object-name>audio_mech_sgn</object-name>
|
<object-name>audio_mech_sgn</object-name>
|
||||||
<object-name>audio_voice_led</object-name>
|
|
||||||
<object-name>audio_vhf1_led</object-name>
|
|
||||||
<object-name>audio_vhf2_led</object-name>
|
|
||||||
<object-name>audio_vhf3_led</object-name>
|
|
||||||
<object-name>autoland_light_on</object-name>
|
<object-name>autoland_light_on</object-name>
|
||||||
<object-name>ecam_clr_l_led</object-name>
|
<object-name>ecam_clr_l_led</object-name>
|
||||||
<object-name>ecam_clr_r_led</object-name>
|
<object-name>ecam_clr_r_led</object-name>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
56
Nasal/acp.nas
Normal file
56
Nasal/acp.nas
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
# A3XX Audio Control Panel
|
||||||
|
# merspieler
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Copyright (c) merspieler #
|
||||||
|
############################
|
||||||
|
|
||||||
|
# NOTE: This is just temporary until FG allows a full implementation of the audio system.
|
||||||
|
|
||||||
|
var vhf1_recive = props.globals.initNode("/controls/audio/acp[0]/vhf1-recive", 1, "BOOL");
|
||||||
|
var vhf2_recive = props.globals.initNode("/controls/audio/acp[0]/vhf2-recive", 1, "BOOL");
|
||||||
|
|
||||||
|
var vhf1_volume = props.globals.initNode("/controls/audio/acp[0]/vhf1-volume", 1, "DOUBLE");
|
||||||
|
var vhf2_volume = props.globals.initNode("/controls/audio/acp[0]/vhf2-volume", 1, "DOUBLE");
|
||||||
|
|
||||||
|
var com1_volume = props.globals.getNode("/instrumentation/comm[0]/volume");
|
||||||
|
var com2_volume = props.globals.getNode("/instrumentation/comm[1]/volume");
|
||||||
|
|
||||||
|
var init = func() {
|
||||||
|
vhf1_recive.setValue(1);
|
||||||
|
vhf2_recive.setValue(1);
|
||||||
|
vhf1_volume.setValue(1);
|
||||||
|
vhf2_volume.setValue(0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
var update_instruments = func(com_no) {
|
||||||
|
if (com_no == 0) {
|
||||||
|
if (vhf1_recive.getValue()) {
|
||||||
|
com1_volume.setValue(vhf1_volume.getValue());
|
||||||
|
} else {
|
||||||
|
com1_volume.setValue(0);
|
||||||
|
}
|
||||||
|
} else if (com_no == 1) {
|
||||||
|
if (vhf2_recive.getValue()) {
|
||||||
|
com2_volume.setValue(vhf2_volume.getValue());
|
||||||
|
} else {
|
||||||
|
com2_volume.setValue(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setlistener("/controls/audio/acp[0]/vhf1-recive", func {
|
||||||
|
update_instruments(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
setlistener("/controls/audio/acp[0]/vhf1-volume", func {
|
||||||
|
update_instruments(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
setlistener("/controls/audio/acp[0]/vhf2-recive", func {
|
||||||
|
update_instruments(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
setlistener("/controls/audio/acp[0]/vhf2-volume", func {
|
||||||
|
update_instruments(1);
|
||||||
|
});
|
|
@ -193,6 +193,7 @@ var systemsInit = func {
|
||||||
libraries.BUTTONS.init();
|
libraries.BUTTONS.init();
|
||||||
libraries.variousReset();
|
libraries.variousReset();
|
||||||
rmp.init();
|
rmp.init();
|
||||||
|
acp.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
setlistener("/sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/fdm-initialized", func {
|
||||||
|
|
Reference in a new issue