A3XX: Make engine start in panel states much much faster

This commit is contained in:
Joshua Davidson 2017-10-05 10:53:24 -04:00
parent aa0bf3bbb6
commit 2a400ea928
5 changed files with 77 additions and 38 deletions

View file

@ -178,6 +178,8 @@ var colddark = func {
spinning.start();
ps_load_dlg.open();
setprop("/systems/acconfig/autoconfig-running", 1);
setprop("/controls/gear/brake-left", 1);
setprop("/controls/gear/brake-right", 1);
# Initial shutdown, and reinitialization.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
@ -211,6 +213,8 @@ var colddark_b = func {
setprop("/controls/bleed/OHP/bleedapu", 0);
setprop("/controls/electrical/switches/battery1", 0);
setprop("/controls/electrical/switches/battery2", 0);
setprop("/controls/gear/brake-left", 0);
setprop("/controls/gear/brake-right", 0);
setprop("/systems/acconfig/autoconfig-running", 0);
ps_load_dlg.close();
ps_loaded_dlg.open();
@ -222,6 +226,8 @@ var beforestart = func {
spinning.start();
ps_load_dlg.open();
setprop("/systems/acconfig/autoconfig-running", 1);
setprop("/controls/gear/brake-left", 1);
setprop("/controls/gear/brake-right", 1);
# First, we set everything to cold and dark.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
@ -284,6 +290,8 @@ var beforestart_b = func {
setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/lighting/beacon", 1);
setprop("/controls/lighting/nav-lights-switch", 1);
setprop("/controls/gear/brake-left", 0);
setprop("/controls/gear/brake-right", 0);
setprop("/systems/acconfig/autoconfig-running", 0);
ps_load_dlg.close();
ps_loaded_dlg.open();
@ -295,6 +303,8 @@ var taxi = func {
spinning.start();
ps_load_dlg.open();
setprop("/systems/acconfig/autoconfig-running", 1);
setprop("/controls/gear/brake-left", 1);
setprop("/controls/gear/brake-right", 1);
# First, we set everything to cold and dark.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
@ -360,31 +370,22 @@ var taxi_b = func {
}
var taxi_c = func {
setprop("/controls/engines/engine-start-switch", 2);
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
var eng_two_chk = setlistener("/engines/engine[1]/state", func {
if (getprop("/engines/engine[1]/state") == 3) {
removelistener(eng_two_chk);
taxi_d();
}
});
}
var taxi_d = func {
# Start engine 1.
setprop("/controls/engines/engine[0]/cutoff-switch", 0);
var eng_one_chk = setlistener("/engines/engine[0]/n2", func {
if (getprop("/engines/engine[0]/n2") >= 58.0) {
removelistener(eng_one_chk);
taxi_e();
}
});
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
settimer(func {
taxi_d();
}, 10);
}
var taxi_e = func {
var taxi_d = func {
# After Start items.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0);
setprop("/controls/pneumatic/switches/bleedapu", 0);
setprop("/controls/lighting/taxi-light-switch", 1);
setprop("/controls/gear/brake-left", 0);
setprop("/controls/gear/brake-right", 0);
setprop("/systems/acconfig/autoconfig-running", 0);
ps_load_dlg.close();
ps_loaded_dlg.open();

View file

@ -25,16 +25,18 @@ var autobrake_init = func {
# Override FG's generic brake, so we can use toe brakes to disconnect autobrake
controls.applyBrakes = func(v, which = 0) {
wow1 = getprop("/gear/gear[1]/wow");
wow2 = getprop("/gear/gear[2]/wow");
if (getprop("/controls/autobrake/mode") != 0 and (wow1 or wow2)) {
arm_autobrake(0);
}
if (which <= 0) {
interpolate("/controls/gear/brake-left", v, 0.5);
}
if (which >= 0) {
interpolate("/controls/gear/brake-right", v, 0.5);
if (getprop("/systems/acconfig/autoconfig-running") != 1) {
wow1 = getprop("/gear/gear[1]/wow");
wow2 = getprop("/gear/gear[2]/wow");
if (getprop("/controls/autobrake/mode") != 0 and (wow1 or wow2)) {
arm_autobrake(0);
}
if (which <= 0) {
interpolate("/controls/gear/brake-left", v, 0.5);
}
if (which >= 0) {
interpolate("/controls/gear/brake-right", v, 0.5);
}
}
}

View file

@ -54,10 +54,14 @@ var eng_init = func {
setlistener("/controls/engines/engine[0]/cutoff-switch", func {
if (getprop("/controls/engines/engine[0]/cutoff-switch") == 0) {
if (getprop("/controls/engines/engine[0]/man-start") == 0) {
start_one_check();
} else if (getprop("/controls/engines/engine[0]/man-start") == 1) {
eng_one_man_startt.start();
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
fast_start_one();
} else {
if (getprop("/controls/engines/engine[0]/man-start") == 0) {
start_one_check();
} else if (getprop("/controls/engines/engine[0]/man-start") == 1) {
eng_one_man_startt.start();
}
}
} else if (getprop("/controls/engines/engine[0]/cutoff-switch") == 1) {
eng_one_auto_startt.stop();
@ -75,6 +79,20 @@ setlistener("/controls/engines/engine[0]/cutoff-switch", func {
}
});
var fast_start_one = func {
setprop("controls/engines/engine[0]/cutoff", 0);
setprop("engines/engine[0]/out-of-fuel", 0);
setprop("engines/engine[0]/run", 1);
setprop("/engines/engine[0]/cutoff", 0);
setprop("/engines/engine[0]/starter", 0);
setprop("/fdm/jsbsim/propulsion/set-running", 0);
setprop("/engines/engine[0]/state", 3);
setprop("/systems/pneumatic/eng1-starter", 0);
}
setlistener("/controls/engines/engine[0]/man-start", func {
start_one_mancheck();
});
@ -116,10 +134,14 @@ var start_one_check_b = func {
setlistener("/controls/engines/engine[1]/cutoff-switch", func {
if (getprop("/controls/engines/engine[1]/cutoff-switch") == 0) {
if (getprop("/controls/engines/engine[1]/man-start") == 0) {
start_two_check();
} else if (getprop("/controls/engines/engine[1]/man-start") == 1) {
eng_two_man_startt.start();
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
fast_start_two();
} else {
if (getprop("/controls/engines/engine[1]/man-start") == 0) {
start_two_check();
} else if (getprop("/controls/engines/engine[1]/man-start") == 1) {
eng_two_man_startt.start();
}
}
} else if (getprop("/controls/engines/engine[1]/cutoff-switch") == 1) {
eng_two_auto_startt.stop();
@ -136,6 +158,20 @@ setlistener("/controls/engines/engine[1]/cutoff-switch", func {
}
});
var fast_start_two = func {
setprop("controls/engines/engine[1]/cutoff", 0);
setprop("engines/engine[1]/out-of-fuel", 0);
setprop("engines/engine[1]/run", 1);
setprop("/engines/engine[1]/cutoff", 0);
setprop("/engines/engine[1]/starter", 0);
setprop("/fdm/jsbsim/propulsion/set-running", 1);
setprop("/engines/engine[1]/state", 3);
setprop("/systems/pneumatic/eng2-starter", 0);
}
setlistener("/controls/engines/engine[1]/man-start", func {
start_two_mancheck();
});

View file

@ -744,7 +744,7 @@
</equals>
<greater-than>
<property>/engines/engine[0]/n1</property>
<value>22</value>
<value>19</value>
</greater-than>
</and>
</condition>
@ -775,7 +775,7 @@
</equals>
<greater-than>
<property>/engines/engine[1]/n1</property>
<value>22</value>
<value>19</value>
</greater-than>
</and>
</condition>

View file

@ -1 +1 @@
2101
2102