From a267dc58232e4bc5bdbc91ef8210e3443f428444 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 2 Sep 2021 20:29:35 +0100 Subject: [PATCH 1/2] Typo fix --- Nasal/Displays/DMC.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/Displays/DMC.nas b/Nasal/Displays/DMC.nas index efe94e5b..64b2c274 100644 --- a/Nasal/Displays/DMC.nas +++ b/Nasal/Displays/DMC.nas @@ -75,7 +75,7 @@ var DMController = { # update DMC2 to correct properties for first officer PFD me.DMCs[1].altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)]; me.DMCs[1].altitudesPfd = [props.globals.getNode("/instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)]; - me.DMCs[1].altitudeDiffs = [props.globals.getNode("//instrumentation/pfd/alt-diff[3]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[4]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[5]", 1)]; + me.DMCs[1].altitudeDiffs = [props.globals.getNode("/instrumentation/pfd/alt-diff[3]", 1), props.globals.getNode("/instrumentation/pfd/alt-diff[4]", 1), props.globals.getNode("/instrumentation/pfd/alt-diff[5]", 1)]; me._init = 1; } }, From 6af9c6100830b7c809370ccb0a2522e8ee9e8d42 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Thu, 2 Sep 2021 21:02:35 +0100 Subject: [PATCH 2/2] HF radio: fix nasal typo; improve efficiency of code. ACP: improve behaviour of INT-RAD switch. HF sounds: set to avionics mode --- Models/Instruments/Audio/Audio1.xml | 39 +++++++++++++++++++--- Models/Instruments/Audio/Audio2.xml | 39 +++++++++++++++++++--- Nasal/Systems/Comm/HF.nas | 50 +++++++++++++++++------------ Sounds/A320-common-sound.xml | 4 +++ 4 files changed, 101 insertions(+), 31 deletions(-) diff --git a/Models/Instruments/Audio/Audio1.xml b/Models/Instruments/Audio/Audio1.xml index c4ba9360..b76579e3 100644 --- a/Models/Instruments/Audio/Audio1.xml +++ b/Models/Instruments/Audio/Audio1.xml @@ -29,25 +29,54 @@ property-assign controls/audio/acp[0]/int-rad - 2 + 1 + + + + controls/audio/acp[0]/int-rad + 2 + + + - - - property-assign controls/audio/acp[0]/int-rad - 1 + 0 + + + controls/audio/acp[0]/int-rad + 2 + + property-assign controls/audio/acp[0]/int-rad 0 + + + + controls/audio/acp[0]/int-rad + 2 + + + + + + + property-cycle + controls/audio/acp[0]/int-rad + 2 + 0 + + + rotate audio_int_rad diff --git a/Models/Instruments/Audio/Audio2.xml b/Models/Instruments/Audio/Audio2.xml index d42c9714..87a89d6e 100644 --- a/Models/Instruments/Audio/Audio2.xml +++ b/Models/Instruments/Audio/Audio2.xml @@ -29,25 +29,54 @@ property-assign controls/audio/acp[1]/int-rad - 2 + 1 + + + + controls/audio/acp[1]/int-rad + 2 + + + - - - property-assign controls/audio/acp[1]/int-rad - 1 + 0 + + + controls/audio/acp[1]/int-rad + 2 + + property-assign controls/audio/acp[1]/int-rad 0 + + + + controls/audio/acp[1]/int-rad + 2 + + + + + + + property-cycle + controls/audio/acp[1]/int-rad + 2 + 0 + + + rotate audio_int_rad diff --git a/Nasal/Systems/Comm/HF.nas b/Nasal/Systems/Comm/HF.nas index 3440d4d6..0d9df45d 100644 --- a/Nasal/Systems/Comm/HF.nas +++ b/Nasal/Systems/Comm/HF.nas @@ -100,7 +100,7 @@ var highFrequencyRadio = { } }, datalink: func() { - if (me.powerNode.getValue() < 115) { + if (me.powerNode.getValue() < 110) { me.datalinkConnected = 0; return; } @@ -118,33 +118,41 @@ var HFS = [highFrequencyRadio.new(systems.ELEC.Bus.acEssShed, 0), highFrequencyR # Can't use setlistener on the voltage as it always gets written to by JSB (and changes according to engine rpm) var update_items_HF_radio = [ - props.UpdateManager.FromHashValue("elecACEssShed", 0.1, func(val) + props.UpdateManager.FromHashValue("elecACEssShed", 0.2, func(val) { if (val < 110) { - HFS[0].transmit = 0; - HFS[0].receptionProp.setValue(0); - toneTimer1.stop(); - transmitTimer1.stop(); - HFS[0].toneControl.setValue(0); - HFS[0]._toneTime = nil; - ecam.transmitFlag1 = 0; + if (HFS[0].receptionProp.getBoolValue()) { + HFS[0].transmit = 0; + HFS[0].receptionProp.setValue(0); + toneTimer1.stop(); + transmitTimer1.stop(); + HFS[0].toneControl.setValue(0); + HFS[0]._toneTime = nil; + ecam.transmitFlag1 = 0; + } } else { - HFS[0].receptionProp.setValue(1); + if (!HFS[0].receptionProp.getBoolValue()) { + HFS[0].receptionProp.setValue(1); + } } } ), - props.UpdateManager.FromHashValue("elecAC2", 0.1, func(val) + props.UpdateManager.FromHashValue("elecAC2", 0.2, func(val) { - if (val) { - HFS[1].transmit = 0; - HFS[1].receptionProp.setValue(0); - toneTimer2.stop(); - transmitTimer2.stop(); - HFS[1].toneControl.setValue(0); - HFS[1]._toneTime = nil; - ecam.transmitFlag2 = 0; + if (val < 110) { + if (HFS[1].receptionProp.getBoolValue()) { + HFS[1].transmit = 0; + HFS[1].receptionProp.setValue(0); + toneTimer2.stop(); + transmitTimer2.stop(); + HFS[1].toneControl.setValue(0); + HFS[1]._toneTime = nil; + ecam.transmitFlag2 = 0; + } } else { - HFS[1].receptionProp.setValue(1); + if (!HFS[1].receptionProp.getBoolValue()) { + HFS[1].receptionProp.setValue(1); + } } } ), @@ -178,4 +186,4 @@ var transmitTimer1 = maketimer(1, func() { var transmitTimer2 = maketimer(1, func() { HFS[1].monitorPTT(); -}); +}); \ No newline at end of file diff --git a/Sounds/A320-common-sound.xml b/Sounds/A320-common-sound.xml index 38673039..0aa719b1 100644 --- a/Sounds/A320-common-sound.xml +++ b/Sounds/A320-common-sound.xml @@ -1618,6 +1618,7 @@ HF PTT tone looped + avionics Aircraft/A320-family/Sounds/Cockpit/1000hz.wav @@ -1635,6 +1636,7 @@ HF PTT tone 2 looped + avionics Aircraft/A320-family/Sounds/Cockpit/1000hz.wav @@ -1652,6 +1654,7 @@ HF static looped + avionics Aircraft/A320-family/Sounds/Cockpit/hf-radio-static.wav @@ -1670,6 +1673,7 @@ HF static 2 looped + avionics Aircraft/A320-family/Sounds/Cockpit/hf-radio-static.wav