System: engines state no longer stuck when running out of fuel

This commit is contained in:
Joshua Davidson 2018-04-03 13:46:19 -04:00
parent d0a8057a38
commit 86c24f5896
6 changed files with 70 additions and 47 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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 {

Binary file not shown.

Binary file not shown.

View file

@ -1 +1 @@
4317
4318