diff --git a/Nasal/engines-cfm.nas b/Nasal/engines-cfm.nas index 81106e6d..271ee991 100644 --- a/Nasal/engines-cfm.nas +++ b/Nasal/engines-cfm.nas @@ -46,21 +46,25 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func { } } } else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) { - eng_one_auto_start.stop(); - eng_one_man_start.stop(); - eng_one_n2_check.stop(); - setprop("/controls/engines/engine[0]/igniter-a", 0); - setprop("/controls/engines/engine[0]/igniter-b", 0); - setprop("/controls/engines/engine[0]/man-start", 0); - setprop("/systems/pneumatic/eng1-starter", 0); - setprop("/controls/engines/engine[0]/starter", 0); - setprop("/controls/engines/engine[0]/cutoff", 1); - setprop("/engines/engine[0]/state", 0); - interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time); - eng_one_n2_check.stop(); + cutoff_one(); } }); +var cutoff_one = func { + eng_one_auto_start.stop(); + eng_one_man_start.stop(); + eng_one_n2_check.stop(); + setprop("/controls/engines/engine[0]/igniter-a", 0); + setprop("/controls/engines/engine[0]/igniter-b", 0); + setprop("/controls/engines/engine[0]/man-start", 0); + setprop("/systems/pneumatic/eng1-starter", 0); + setprop("/controls/engines/engine[0]/starter", 0); + setprop("/controls/engines/engine[0]/cutoff", 1); + setprop("/engines/engine[0]/state", 0); + interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time); + eng_one_n2_check.stop(); +} + var fast_start_one = func { setprop("/controls/engines/engine[0]/cutoff", 0); setprop("/engines/engine[0]/out-of-fuel", 0); @@ -126,20 +130,24 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func { } } } else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) { - eng_two_auto_start.stop(); - eng_two_man_start.stop(); - eng_two_n2_check.stop(); - setprop("/controls/engines/engine[1]/igniter-a", 0); - setprop("/controls/engines/engine[1]/igniter-b", 0); - setprop("/controls/engines/engine[1]/man-start", 0); - setprop("/systems/pneumatic/eng2-starter", 0); - setprop("/controls/engines/engine[1]/starter", 0); - setprop("/controls/engines/engine[1]/cutoff", 1); - setprop("/engines/engine[1]/state", 0); - interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time); + cutoff_two(); } }); +var cutoff_two = func { + eng_two_auto_start.stop(); + eng_two_man_start.stop(); + eng_two_n2_check.stop(); + setprop("/controls/engines/engine[1]/igniter-a", 0); + setprop("/controls/engines/engine[1]/igniter-b", 0); + setprop("/controls/engines/engine[1]/man-start", 0); + setprop("/systems/pneumatic/eng2-starter", 0); + setprop("/controls/engines/engine[1]/starter", 0); + setprop("/controls/engines/engine[1]/cutoff", 1); + setprop("/engines/engine[1]/state", 0); + interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time); +} + var fast_start_two = func { setprop("/controls/engines/engine[1]/cutoff", 0); setprop("/engines/engine[1]/out-of-fuel", 0); diff --git a/Nasal/engines-iae.nas b/Nasal/engines-iae.nas index 41af3a12..b8ba6853 100644 --- a/Nasal/engines-iae.nas +++ b/Nasal/engines-iae.nas @@ -46,21 +46,25 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func { } } } else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) { - eng_one_auto_start.stop(); - eng_one_man_start.stop(); - eng_one_n2_check.stop(); - setprop("/controls/engines/engine[0]/igniter-a", 0); - setprop("/controls/engines/engine[0]/igniter-b", 0); - setprop("/controls/engines/engine[0]/man-start", 0); - setprop("/systems/pneumatic/eng1-starter", 0); - setprop("/controls/engines/engine[0]/starter", 0); - setprop("/controls/engines/engine[0]/cutoff", 1); - setprop("/engines/engine[0]/state", 0); - interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time); - eng_one_n2_check.stop(); + cutoff_one(); } }); +var cutoff_one = func { + eng_one_auto_start.stop(); + eng_one_man_start.stop(); + eng_one_n2_check.stop(); + setprop("/controls/engines/engine[0]/igniter-a", 0); + setprop("/controls/engines/engine[0]/igniter-b", 0); + setprop("/controls/engines/engine[0]/man-start", 0); + setprop("/systems/pneumatic/eng1-starter", 0); + setprop("/controls/engines/engine[0]/starter", 0); + setprop("/controls/engines/engine[0]/cutoff", 1); + setprop("/engines/engine[0]/state", 0); + interpolate(engines[0].getNode("egt-actual"), 0, egt_shutdown_time); + eng_one_n2_check.stop(); +} + var fast_start_one = func { setprop("/controls/engines/engine[0]/cutoff", 0); setprop("/engines/engine[0]/out-of-fuel", 0); @@ -126,20 +130,24 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func { } } } else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) { - eng_two_auto_start.stop(); - eng_two_man_start.stop(); - eng_two_n2_check.stop(); - setprop("/controls/engines/engine[1]/igniter-a", 0); - setprop("/controls/engines/engine[1]/igniter-b", 0); - setprop("/controls/engines/engine[1]/man-start", 0); - setprop("/systems/pneumatic/eng2-starter", 0); - setprop("/controls/engines/engine[1]/starter", 0); - setprop("/controls/engines/engine[1]/cutoff", 1); - setprop("/engines/engine[1]/state", 0); - interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time); + cutoff_two(); } }); +var cutoff_two = func { + eng_two_auto_start.stop(); + eng_two_man_start.stop(); + eng_two_n2_check.stop(); + setprop("/controls/engines/engine[1]/igniter-a", 0); + setprop("/controls/engines/engine[1]/igniter-b", 0); + setprop("/controls/engines/engine[1]/man-start", 0); + setprop("/systems/pneumatic/eng2-starter", 0); + setprop("/controls/engines/engine[1]/starter", 0); + setprop("/controls/engines/engine[1]/cutoff", 1); + setprop("/engines/engine[1]/state", 0); + interpolate(engines[1].getNode("egt-actual"), 0, egt_shutdown_time); +} + var fast_start_two = func { setprop("/controls/engines/engine[1]/cutoff", 0); setprop("/engines/engine[1]/out-of-fuel", 0); diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index 8a420f55..a7540f01 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -238,6 +238,13 @@ var systemsLoop = maketimer(0.1, func { } else { setprop("/engines/ready", 0); } + + if ((getprop("/engines/engine[0]/state") == 2 or getprop("/engines/engine[0]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[3]/contents-lbs") < 1) { + systems.cutoff_one(); + } + if ((getprop("/engines/engine[1]/state") == 2 or getprop("/engines/engine[1]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[4]/contents-lbs") < 1) { + systems.cutoff_two(); + } }); setlistener("/options/steep-ils", func { diff --git a/Sounds/FL2070/iae11a.wav b/Sounds/FL2070/iae11a.wav index 6107f1cc..e99c071e 100644 Binary files a/Sounds/FL2070/iae11a.wav and b/Sounds/FL2070/iae11a.wav differ diff --git a/Sounds/FL2070/iae11b.wav b/Sounds/FL2070/iae11b.wav index 6107f1cc..e99c071e 100644 Binary files a/Sounds/FL2070/iae11b.wav and b/Sounds/FL2070/iae11b.wav differ diff --git a/revision.txt b/revision.txt index 0dee72db..b093c522 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4317 \ No newline at end of file +4318 \ No newline at end of file