1
0
Fork 0

Add a quickly generated sound which plays after 15 / 5 seconds when you receive a CPDLC message

This commit is contained in:
legoboyvdlp R 2020-11-30 19:17:32 +00:00
parent 0410a0fc91
commit 6debf52e8c
4 changed files with 32 additions and 11 deletions

View file

@ -16,6 +16,8 @@ var dcdu_test_time = props.globals.initNode("/instrumentation/du/dcdu-test-time"
var dcdu_offtime = props.globals.initNode("/instrumentation/du/dcdu-off-time", 0.0, "DOUBLE");
var dcdu_test_amount = props.globals.initNode("/instrumentation/du/dcdu-test-amount", 0.0, "DOUBLE");
# todo 16.5 watts
var canvas_DCDU_base = {
init: func(canvas_group, file) {
var font_mapper = func(family, weight) {
@ -117,7 +119,7 @@ var canvas_DCDU = {
me["MessageTimeStamp"].hide();
me["RecallMode"].hide();
me["LinkLost"].hide();
me["Recall"].hide();
me["Recall"].show();
me["Close"].hide();
if (atsu.ADS.getCount() != me.cache.adsCount) {

View file

@ -18,26 +18,29 @@ var CPDLCnewMsgLight = props.globals.initNode("/network/cpdlc/new-message-light"
setlistener("/network/cpdlc/rx/new-message", func() {
if (CPDLCnewMsgFlag.getBoolValue()) {
# add to DCDU message buffer to display
ATCMSGRingCancel = 0;
ATCMSGRing();
var messageType = 0; # urgent or normal
ATCMSGRing(messageType);
ATCMsgFlashCancel = 0;
ATCMSGFlash();
# ATC MSG pushbutton: flashes, ringtone after 15 secs, therafter every 15 secs
# add DCDU prompts (wilco, etc) associated to message --> so the CPDLC message object must store the correct response for the actual message
CPDLCnewMsgFlag.setBoolValue(0);
}
}, 0, 0);
}, 0, 1);
var ATCMSGRingCancel = 0;
var ATCMSGRing = func() {
CPDLCnewMsgAlert.setBoolValue(0);
var ATCMSGRing = func(messageType) {
print("Going to ring");
settimer(func() {
if (!ATCMSGRingCancel) {
CPDLCnewMsgAlert.setBoolValue(1);
ATCMSGRing();
print("Rang, will ring 15 seconds later again");
CPDLCnewMsgAlert.setBoolValue(0);
settimer(func() {
CPDLCnewMsgAlert.setBoolValue(1);
ATCMSGRing(messageType);
}, 0.1);
}
}, 15);
}, (messageType == 0 ? 15 : 5));
};
var ATCMsgFlashCancel = 0;

View file

@ -1913,6 +1913,22 @@
</volume>
</announcements>
<atc-msg>
<name>ATC MSG</name>
<path>Aircraft/A320-family/Sounds/Cockpit/ATC-msg-ring.wav</path>
<mode>once</mode>
<type>avionics</type>
<condition>
<property>/network/cpdlc/new-message-ringtone</property>
</condition>
<volume>
<property>/sim/current-view/internal</property>
<factor>1.5</factor>
</volume>
<reference-dist>10</reference-dist>
<max-dist>100</max-dist>
</atc-msg>
<chime>
<name>Chime</name>
<path>Aircraft/A320-family/Sounds/Cockpit/chime.wav</path>
@ -1946,7 +1962,7 @@
<reference-dist>10</reference-dist>
<max-dist>100</max-dist>
</crc>
<cricket>
<name>Cricket</name>
<path>Aircraft/A320-family/Sounds/Cockpit/cricket.wav</path>

Binary file not shown.