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,6 +46,11 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func {
}
}
} else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) {
cutoff_one();
}
});
var cutoff_one = func {
eng_one_auto_start.stop();
eng_one_man_start.stop();
eng_one_n2_check.stop();
@ -58,8 +63,7 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func {
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);
@ -126,6 +130,11 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func {
}
}
} else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) {
cutoff_two();
}
});
var cutoff_two = func {
eng_two_auto_start.stop();
eng_two_man_start.stop();
eng_two_n2_check.stop();
@ -137,8 +146,7 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func {
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);

View file

@ -46,6 +46,11 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func {
}
}
} else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) {
cutoff_one();
}
});
var cutoff_one = func {
eng_one_auto_start.stop();
eng_one_man_start.stop();
eng_one_n2_check.stop();
@ -58,8 +63,7 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func {
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);
@ -126,6 +130,11 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func {
}
}
} else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) {
cutoff_two();
}
});
var cutoff_two = func {
eng_two_auto_start.stop();
eng_two_man_start.stop();
eng_two_n2_check.stop();
@ -137,8 +146,7 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func {
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);

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