This commit is contained in:
merspieler 2018-09-28 23:45:32 +02:00
commit 000fd3cffb
18 changed files with 435 additions and 222 deletions

View file

@ -644,6 +644,7 @@
<OH> <OH>
<protectors> <protectors>
<ditching type="bool">0</ditching> <ditching type="bool">0</ditching>
<elecratman type="bool">0</elecratman>
<eng1-manstart type="bool">0</eng1-manstart> <eng1-manstart type="bool">0</eng1-manstart>
<eng2-manstart type="bool">0</eng2-manstart> <eng2-manstart type="bool">0</eng2-manstart>
<eng1-n1 type="bool">0</eng1-n1> <eng1-n1 type="bool">0</eng1-n1>

View file

@ -229,9 +229,6 @@ var colddark_b = func {
# Continues the Cold and Dark script, after engines fully shutdown. # Continues the Cold and Dark script, after engines fully shutdown.
setprop("/controls/APU/master", 0); setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0); setprop("/controls/APU/start", 0);
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-left", 0);
setprop("/controls/gear/brake-right", 0); setprop("/controls/gear/brake-right", 0);
setprop("/systems/acconfig/autoconfig-running", 0); setprop("/systems/acconfig/autoconfig-running", 0);
@ -265,9 +262,6 @@ var beforestart = func {
failReset(); failReset();
setprop("/controls/APU/master", 0); setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0); setprop("/controls/APU/start", 0);
setprop("/controls/bleed/OHP/bleedapu", 0);
setprop("/controls/electrical/switches/battery1", 0);
setprop("/controls/electrical/switches/battery2", 0);
# Now the Startup! # Now the Startup!
setprop("/controls/electrical/switches/battery1", 1); setprop("/controls/electrical/switches/battery1", 1);
@ -343,8 +337,6 @@ var taxi = func {
failReset(); failReset();
setprop("/controls/APU/master", 0); setprop("/controls/APU/master", 0);
setprop("/controls/APU/start", 0); setprop("/controls/APU/start", 0);
setprop("/controls/electrical/switches/battery1", 0);
setprop("/controls/electrical/switches/battery2", 0);
# Now the Startup! # Now the Startup!
setprop("/controls/electrical/switches/battery1", 1); setprop("/controls/electrical/switches/battery1", 1);

View file

@ -1287,10 +1287,12 @@ var canvas_lowerECAM_elec = {
if (switch_emer_gen.getValue() == 0) { if (switch_emer_gen.getValue() == 0) {
me["EMERGEN-group"].hide(); me["EMERGEN-group"].hide();
me["ELEC-Line-Emergen-ESSTR"].hide(); me["ELEC-Line-Emergen-ESSTR"].hide();
me["ELEC-Line-Emergen-ESSTR-off"].show();
me["EMERGEN-Label-off"].show(); me["EMERGEN-Label-off"].show();
} else { } else {
me["EMERGEN-group"].show(); me["EMERGEN-group"].show();
me["ELEC-Line-Emergen-ESSTR"].show(); me["ELEC-Line-Emergen-ESSTR"].show();
me["ELEC-Line-Emergen-ESSTR-off"].hide();
me["EMERGEN-Label-off"].hide(); me["EMERGEN-Label-off"].hide();
} }

View file

@ -643,7 +643,7 @@ var canvas_MCDU_base = {
if (getprop("/FMGC/internal/adf1freq-set") == 1) { if (getprop("/FMGC/internal/adf1freq-set") == 1) {
me["Simple_L5"].setFont(default); me["Simple_L5"].setFont(default);
me["Simple_L5"].setFontSize(normal); me["Simple_L5"].setFontSize(normal);
me["Simple_L5"].setText(sprintf("%3.0f", adf1)); me["Simple_L5"].setText(sprintf("%s", adf1));
} else { } else {
me["Simple_L5"].setFont(symbol); me["Simple_L5"].setFont(symbol);
me["Simple_L5"].setFontSize(small); me["Simple_L5"].setFontSize(small);
@ -663,7 +663,7 @@ var canvas_MCDU_base = {
if (getprop("/FMGC/internal/adf2freq-set") == 1) { if (getprop("/FMGC/internal/adf2freq-set") == 1) {
me["Simple_R5"].setFont(default); me["Simple_R5"].setFont(default);
me["Simple_R5"].setFontSize(normal); me["Simple_R5"].setFontSize(normal);
me["Simple_R5"].setText(sprintf("%3.0f", adf2)); me["Simple_R5"].setText(sprintf("%s", adf2));
} else { } else {
me["Simple_R5"].setFont(symbol); me["Simple_R5"].setFont(symbol);
me["Simple_R5"].setFontSize(small); me["Simple_R5"].setFontSize(small);

View file

@ -3312,7 +3312,88 @@
</or> </or>
</condition> </condition>
</animation> </animation>
<animation>
<name>ELEC RAT MAN pick</name>
<type>pick</type>
<object-name>EmerElecManOnBtn</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<condition>
<and>
<equals>
<property>controls/OH/protectors/elecratman</property>
<value>1</value>
</equals>
<or>
<greater-than-equals>
<property>systems/electrical/bus/dcbat</property>
<value>25</value>
</greater-than-equals>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</or>
</and>
</condition>
<command>property-toggle</command>
<property>controls/electrical/switches/rat-man</property>
</binding>
<binding>
<condition>
<equals>
<property>controls/OH/protectors/elecratman</property>
<value>1</value>
</equals>
</condition>
<command>nasal</command>
<script>setprop("/sim/sounde/oh-btn", 1);</script>
</binding>
</action>
</animation>
<animation>
<type>pick</type>
<object-name>EmerManOnGuard</object-name>
<action>
<button>1</button>
<binding>
<command>property-assign</command>
<property>controls/OH/protectors/elecratman</property>
<value>1</value>
</binding>
<mod-up>
<binding>
<command>property-assign</command>
<property>controls/OH/protectors/elecratman</property>
<value>0</value>
</binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/oh-cover", 1);</script>
</binding>
</mod-up>
</action>
</animation>
<animation>
<type>rotate</type>
<object-name>EmerManOnGuard</object-name>
<property>controls/OH/protectors/elecratman</property>
<factor>-145</factor>
<axis>
<x1-m>-0.00273</x1-m>
<y1-m>-0.20848</y1-m>
<z1-m>-0.02796</z1-m>
<x2-m>-0.00420</x2-m>
<y2-m>-0.19657</y2-m>
<z2-m>-0.02796</z2-m>
</axis>
</animation>
<!-- Pneumatic --> <!-- Pneumatic -->
<animation> <animation>
<name>AC pack flow pick</name> <name>AC pack flow pick</name>

View file

@ -110,7 +110,7 @@ setlistener("/it-autoflight/input/ap1", func {
fmabox(); fmabox();
updateTimers(); updateTimers();
} else if (apmas == 1 and ac_ess >= 110 and law == 0) { } else if (apmas == 1 and ac_ess >= 110 and law == 0) {
if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/gear/gear[2]/wow") == 0)) { if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and getprop("/position/gear-agl-ft") >= 100) {
if (getprop("/it-autoflight/output/lat") == 9) { if (getprop("/it-autoflight/output/lat") == 9) {
setprop("/it-autoflight/input/lat", 3); setprop("/it-autoflight/input/lat", 3);
} }
@ -146,7 +146,7 @@ setlistener("/it-autoflight/input/ap2", func {
fmabox(); fmabox();
updateTimers(); updateTimers();
} else if (apmas == 1 and ac_ess >= 110 and law == 0) { } else if (apmas == 1 and ac_ess >= 110 and law == 0) {
if ((getprop("/gear/gear[1]/wow") == 0) and (getprop("/gear/gear[2]/wow") == 0)) { if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0 and getprop("/position/gear-agl-ft") >= 100) {
if (getprop("/it-autoflight/output/lat") == 9) { if (getprop("/it-autoflight/output/lat") == 9) {
setprop("/it-autoflight/input/lat", 3); setprop("/it-autoflight/input/lat", 3);
} }

View file

@ -25,6 +25,8 @@ setprop("/FMGC/internal/ils1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99"); setprop("/FMGC/internal/ils2-mcdu", "XXX/999.99");
setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99"); setprop("/FMGC/internal/vor1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX"); setprop("/FMGC/internal/vor2-mcdu", "999.99/XXX");
setprop("/FMGC/internal/adf1-mcdu", "XXX/999.99");
setprop("/FMGC/internal/adf2-mcdu", "999.99/XXX");
setprop("/gear/gear[0]/wow-fmgc", 1); setprop("/gear/gear[0]/wow-fmgc", 1);
setlistener("/sim/signals/fdm-initialized", func { setlistener("/sim/signals/fdm-initialized", func {

View file

@ -34,6 +34,7 @@ setlistener("/sim/signals/fdm-initialized", func {
var ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed"); var ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed");
var battery1_sw = getprop("/controls/electrical/switches/battery1"); var battery1_sw = getprop("/controls/electrical/switches/battery1");
var battery2_sw = getprop("/controls/electrical/switches/battery2"); var battery2_sw = getprop("/controls/electrical/switches/battery2");
var manrat = getprop("/controls/electrical/switches/rat-man");
var battery1_volts = getprop("/systems/electrical/battery1-volts"); var battery1_volts = getprop("/systems/electrical/battery1-volts");
var battery2_volts = getprop("/systems/electrical/battery2-volts"); var battery2_volts = getprop("/systems/electrical/battery2-volts");
var battery1_amps = getprop("/systems/electrical/battery1-amps"); var battery1_amps = getprop("/systems/electrical/battery1-amps");
@ -62,8 +63,7 @@ setlistener("/sim/signals/fdm-initialized", func {
var galley_shed = getprop("/systems/electrical/extra/galleyshed"); var galley_shed = getprop("/systems/electrical/extra/galleyshed");
var emergen = getprop("/controls/electrical/switches/emer-gen"); var emergen = getprop("/controls/electrical/switches/emer-gen");
var ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt"); var ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
var rat = getprop("/controls/hydraulic/rat"); var rat = getprop("/controls/electrical/rat");
var manrat = getprop("/controls/hydraulic/rat-man");
var ac_ess_fail = getprop("/systems/failures/elec-ac-ess"); var ac_ess_fail = getprop("/systems/failures/elec-ac-ess");
var batt1_fail = getprop("/systems/failures/elec-batt1"); var batt1_fail = getprop("/systems/failures/elec-batt1");
var batt2_fail = getprop("/systems/failures/elec-batt2"); var batt2_fail = getprop("/systems/failures/elec-batt2");
@ -158,6 +158,7 @@ var ELEC = {
setprop("/controls/electrical/switches/ac-ess-feed", 0); setprop("/controls/electrical/switches/ac-ess-feed", 0);
setprop("/controls/electrical/switches/battery1", 0); setprop("/controls/electrical/switches/battery1", 0);
setprop("/controls/electrical/switches/battery2", 0); setprop("/controls/electrical/switches/battery2", 0);
setprop("/controls/electrical/switches/rat-man", 0);
setprop("/systems/electrical/battery1-volts", 26.5); setprop("/systems/electrical/battery1-volts", 26.5);
setprop("/systems/electrical/battery2-volts", 26.5); setprop("/systems/electrical/battery2-volts", 26.5);
setprop("/systems/electrical/battery1-amps", 0); setprop("/systems/electrical/battery1-amps", 0);
@ -206,6 +207,7 @@ var ELEC = {
setprop("/systems/electrical/idg2-fault", 0); setprop("/systems/electrical/idg2-fault", 0);
setprop("/controls/electrical/xtie/xtieL", 0); setprop("/controls/electrical/xtie/xtieL", 0);
setprop("/controls/electrical/xtie/xtieR", 0); setprop("/controls/electrical/xtie/xtieR", 0);
setprop("/controls/electrical/rat", 0);
setprop("/systems/electrical/battery-available", 0); setprop("/systems/electrical/battery-available", 0);
setprop("/systems/electrical/dc2-available", 0); setprop("/systems/electrical/dc2-available", 0);
# Below are standard FG Electrical stuff to keep things working when the plane is powered # Below are standard FG Electrical stuff to keep things working when the plane is powered
@ -280,6 +282,7 @@ var ELEC = {
ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed"); ac_ess_feed_sw = getprop("/controls/electrical/switches/ac-ess-feed");
battery1_sw = getprop("/controls/electrical/switches/battery1"); battery1_sw = getprop("/controls/electrical/switches/battery1");
battery2_sw = getprop("/controls/electrical/switches/battery2"); battery2_sw = getprop("/controls/electrical/switches/battery2");
manrat = getprop("/controls/electrical/switches/rat-man");
battery1_volts = getprop("/systems/electrical/battery1-volts"); battery1_volts = getprop("/systems/electrical/battery1-volts");
battery2_volts = getprop("/systems/electrical/battery2-volts"); battery2_volts = getprop("/systems/electrical/battery2-volts");
battery1_percent = getprop("/systems/electrical/battery1-percent"); battery1_percent = getprop("/systems/electrical/battery1-percent");
@ -302,8 +305,7 @@ var ELEC = {
galley_shed = getprop("/systems/electrical/extra/galleyshed"); galley_shed = getprop("/systems/electrical/extra/galleyshed");
emergen = getprop("/controls/electrical/switches/emer-gen"); emergen = getprop("/controls/electrical/switches/emer-gen");
ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt"); ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
rat = getprop("/controls/hydraulic/rat"); rat = getprop("/controls/electrical/rat");
manrat = getprop("/controls/hydraulic/rat-man");
ac_ess_fail = getprop("/systems/failures/elec-ac-ess"); ac_ess_fail = getprop("/systems/failures/elec-ac-ess");
batt1_fail = getprop("/systems/failures/elec-batt1"); batt1_fail = getprop("/systems/failures/elec-batt1");
batt2_fail = getprop("/systems/failures/elec-batt2"); batt2_fail = getprop("/systems/failures/elec-batt2");
@ -594,13 +596,17 @@ var ELEC = {
setprop("/systems/electrical/extra/galleyshed", 0); setprop("/systems/electrical/extra/galleyshed", 0);
} }
if (((ac1 == 0 and ac2 == 0 and ias >= 100) or manrat) and replay == 0) { if (ac1 < 110 and ac2 < 110 and ias >= 100 and replay == 0) {
setprop("/controls/hydraulic/rat-deployed", 1); setprop("/controls/hydraulic/rat-deployed", 1);
setprop("/controls/hydraulic/rat", 1); setprop("/controls/electrical/rat", 1);
setprop("/controls/electrical/switches/emer-gen", 1);
} else if (manrat) {
setprop("/controls/hydraulic/rat-deployed", 1);
setprop("/controls/electrical/rat", 1);
setprop("/controls/electrical/switches/emer-gen", 1); setprop("/controls/electrical/switches/emer-gen", 1);
} }
if (ias < 100 or (ac1 == 1) or (ac2 == 1)) { if (ias < 100 or ac1 >= 110 or ac2 >= 110) {
setprop("/controls/electrical/switches/emer-gen", 0); setprop("/controls/electrical/switches/emer-gen", 0);
} }

View file

@ -31,6 +31,7 @@ setprop("/controls/engines/engine[1]/last-igniter", "B");
var eng_init = func { var eng_init = func {
setprop("/controls/engines/engine[0]/man-start", 0); setprop("/controls/engines/engine[0]/man-start", 0);
setprop("/controls/engines/engine[1]/man-start", 0); setprop("/controls/engines/engine[1]/man-start", 0);
eng_common_init();
} }
# Trigger Startups and Stops # Trigger Startups and Stops

View file

@ -17,10 +17,19 @@ var apu_egt_min = 352;
var apu_egt_max = 704; var apu_egt_max = 704;
setprop("/systems/apu/rpm", 0); setprop("/systems/apu/rpm", 0);
setprop("/systems/apu/egt", 42); setprop("/systems/apu/egt", 42);
setprop("/systems/apu/bleed-used", 0);
setprop("/systems/apu/bleed-counting", 0);
setprop("/systems/apu/bleed-time", 0);
var eng_common_init = func {
setprop("/systems/apu/bleed-used", 0);
}
# Start APU # Start APU
setlistener("/controls/APU/start", func { setlistener("/controls/APU/start", func {
if ((getprop("/controls/APU/master") == 1) and (getprop("/controls/APU/start") == 1)) { if (getprop("/controls/APU/master") == 1 and getprop("/controls/APU/start") == 1) {
apuBleedChk.stop();
setprop("/systems/apu/bleed-counting", 0);
if (getprop("/systems/acconfig/autoconfig-running") == 0) { if (getprop("/systems/acconfig/autoconfig-running") == 0) {
interpolate("/systems/apu/rpm", apu_max, spinup_time); interpolate("/systems/apu/rpm", apu_max, spinup_time);
apu_egt_check.start(); apu_egt_check.start();
@ -56,14 +65,38 @@ setlistener("/controls/APU/master", func {
apu_egt_check.stop(); apu_egt_check.stop();
apu_egt2_check.stop(); apu_egt2_check.stop();
apu_stop(); apu_stop();
} else if (getprop("/controls/APU/master") == 1) {
apuBleedChk.stop();
setprop("/systems/apu/bleed-counting", 0);
} }
}); });
var apu_stop = func { var apu_stop = func {
interpolate("/systems/apu/rpm", 0, 30); if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") != 1) {
interpolate("/systems/apu/egt", 42, 40); setprop("/systems/apu/bleed-counting", 1);
setprop("/systems/apu/bleed-time", getprop("/sim/time/elapsed-sec"));
}
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") == 1) {
apuBleedChk.start();
} else {
apuBleedChk.stop();
interpolate("/systems/apu/rpm", 0, 30);
interpolate("/systems/apu/egt", 42, 40);
setprop("/systems/apu/bleed-counting", 0);
}
} }
var apuBleedChk = maketimer(0.1, func {
if (getprop("/systems/apu/bleed-used") == 1 and getprop("/systems/apu/bleed-counting") == 1) {
if (getprop("/systems/apu/bleed-time") + 60 <= getprop("/sim/time/elapsed-sec")) {
apuBleedChk.stop();
interpolate("/systems/apu/rpm", 0, 30);
interpolate("/systems/apu/egt", 42, 40);
setprop("/systems/apu/bleed-counting", 0);
}
}
});
# Various Other Stuff # Various Other Stuff
var doIdleThrust = func { var doIdleThrust = func {
setprop("/controls/engines/engine[0]/throttle", 0.0); setprop("/controls/engines/engine[0]/throttle", 0.0);

View file

@ -31,6 +31,7 @@ setprop("/controls/engines/engine[1]/last-igniter", "B");
var eng_init = func { var eng_init = func {
setprop("/controls/engines/engine[0]/man-start", 0); setprop("/controls/engines/engine[0]/man-start", 0);
setprop("/controls/engines/engine[1]/man-start", 0); setprop("/controls/engines/engine[1]/man-start", 0);
eng_common_init();
} }
# Trigger Startups and Stops # Trigger Startups and Stops

View file

@ -17,78 +17,126 @@ setprop("/systems/fadec/eng2/ff", 1);
setprop("/systems/fadec/power-avail", 0); setprop("/systems/fadec/power-avail", 0);
setprop("/systems/fadec/powered1", 0); setprop("/systems/fadec/powered1", 0);
setprop("/systems/fadec/powered2", 0); setprop("/systems/fadec/powered2", 0);
setprop("/systems/fadec/powered-time", 0); setprop("/systems/fadec/powered-time", -300);
setprop("/systems/fadec/powerup", 0); setprop("/systems/fadec/powerup", 0);
setprop("/systems/fadec/eng1-master-count", 0);
setprop("/systems/fadec/eng1-master-time", -300);
setprop("/systems/fadec/eng1-off-power", 0);
setprop("/systems/fadec/eng2-master-count", 0);
setprop("/systems/fadec/eng2-master-time", -300);
setprop("/systems/fadec/eng2-off-power", 0);
var fadecLoop = func { var FADEC = {
var ac1 = getprop("/systems/electrical/bus/ac1"); init: func() {
var ac2 = getprop("/systems/electrical/bus/ac2"); setprop("/systems/fadec/powered-time", 0);
var acess = getprop("/systems/electrical/bus/ac-ess"); setprop("/systems/fadec/eng1-master-time", -300);
var state1 = getprop("/engines/engine[0]/state"); setprop("/systems/fadec/eng2-master-time", -300);
var state2 = getprop("/engines/engine[1]/state"); },
var master1 = getprop("/controls/engines/engine[0]/cutoff-switch"); loop: func() {
var master2 = getprop("/controls/engines/engine[1]/cutoff-switch"); var ac1 = getprop("/systems/electrical/bus/ac1");
var modeSel = getprop("/controls/engines/engine-start-switch"); var ac2 = getprop("/systems/electrical/bus/ac2");
var acess = getprop("/systems/electrical/bus/ac-ess");
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) { var state1 = getprop("/engines/engine[0]/state");
if (getprop("/systems/fadec/power-avail") != 1) { var state2 = getprop("/engines/engine[1]/state");
setprop("/systems/fadec/powered-time", getprop("/sim/time/elapsed-sec")); var master1 = getprop("/controls/engines/engine[0]/cutoff-switch");
setprop("/systems/fadec/power-avail", 1); var master2 = getprop("/controls/engines/engine[1]/cutoff-switch");
var modeSel = getprop("/controls/engines/engine-start-switch");
var elapsedSec = getprop("/sim/time/elapsed-sec");
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) {
if (getprop("/systems/fadec/power-avail") != 1) {
setprop("/systems/fadec/powered-time", elapsedSec);
setprop("/systems/fadec/power-avail", 1);
}
} else {
if (getprop("/systems/fadec/power-avail") != 0) {
setprop("/systems/fadec/power-avail", 0);
}
} }
} else {
if (getprop("/systems/fadec/power-avail") != 0) { var powerAvail = getprop("/systems/fadec/power-avail");
setprop("/systems/fadec/power-avail", 0);
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/powerup", 1);
} else {
setprop("/systems/fadec/powerup", 0);
} }
}
if (master1 == 1) {
var powerAvail = getprop("/systems/fadec/power-avail"); if (getprop("/systems/fadec/eng1-master-count") != 1) {
setprop("/systems/fadec/eng1-master-time", elapsedSec);
if (getprop("/systems/fadec/powered-time") + 300 >= getprop("/sim/time/elapsed-sec")) { setprop("/systems/fadec/eng1-master-count", 1);
setprop("/systems/fadec/powerup", 1); }
} else { } else {
setprop("/systems/fadec/powerup", 0); if (getprop("/systems/fadec/eng1-master-count") != 0) {
} setprop("/systems/fadec/eng1-master-count", 0);
}
if (state1 == 3) { }
setprop("/systems/fadec/powered1", 1);
} else if (powerAvail and modeSel == 2) { if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/powered1", 1); setprop("/systems/fadec/eng1-off-power", 1);
} else { } else {
setprop("/systems/fadec/powered1", 0); setprop("/systems/fadec/eng1-off-power", 0);
} }
if (state2 == 3) { if (master2 == 1) {
setprop("/systems/fadec/powered2", 1); if (getprop("/systems/fadec/eng2-master-count") != 1) {
} else if (powerAvail and modeSel == 2) { setprop("/systems/fadec/eng2-master-time", elapsedSec);
setprop("/systems/fadec/powered2", 1); setprop("/systems/fadec/eng2-master-count", 1);
} else { }
setprop("/systems/fadec/powered2", 0); } else {
} if (getprop("/systems/fadec/eng2-master-count") != 0) {
setprop("/systems/fadec/eng2-master-count", 0);
var powered1 = getprop("/systems/fadec/powered1"); }
var powered2 = getprop("/systems/fadec/powered2"); }
if (powered1 or getprop("/systems/fadec/powerup")) { if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/eng1/n1", 1); setprop("/systems/fadec/eng2-off-power", 1);
setprop("/systems/fadec/eng1/egt", 1); } else {
setprop("/systems/fadec/eng1/n2", 1); setprop("/systems/fadec/eng2-off-power", 0);
setprop("/systems/fadec/eng1/ff", 1); }
} else {
setprop("/systems/fadec/eng1/n1", 0); if (state1 == 3) {
setprop("/systems/fadec/eng1/egt", 0); setprop("/systems/fadec/powered1", 1);
setprop("/systems/fadec/eng1/n2", 0); } else if (powerAvail and modeSel == 2) {
setprop("/systems/fadec/eng1/ff", 0); setprop("/systems/fadec/powered1", 1);
} } else {
setprop("/systems/fadec/powered1", 0);
if (powered2 or getprop("/systems/fadec/powerup")) { }
setprop("/systems/fadec/eng2/n1", 1);
setprop("/systems/fadec/eng2/egt", 1); if (state2 == 3) {
setprop("/systems/fadec/eng2/n2", 1); setprop("/systems/fadec/powered2", 1);
setprop("/systems/fadec/eng2/ff", 1); } else if (powerAvail and modeSel == 2) {
} else { setprop("/systems/fadec/powered2", 1);
setprop("/systems/fadec/eng2/n1", 0); } else {
setprop("/systems/fadec/eng2/egt", 0); setprop("/systems/fadec/powered2", 0);
setprop("/systems/fadec/eng2/n2", 0); }
setprop("/systems/fadec/eng2/ff", 0);
} var powered1 = getprop("/systems/fadec/powered1");
} var powered2 = getprop("/systems/fadec/powered2");
if (powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
setprop("/systems/fadec/eng1/n1", 1);
setprop("/systems/fadec/eng1/egt", 1);
setprop("/systems/fadec/eng1/n2", 1);
setprop("/systems/fadec/eng1/ff", 1);
} else {
setprop("/systems/fadec/eng1/n1", 0);
setprop("/systems/fadec/eng1/egt", 0);
setprop("/systems/fadec/eng1/n2", 0);
setprop("/systems/fadec/eng1/ff", 0);
}
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
setprop("/systems/fadec/eng2/n1", 1);
setprop("/systems/fadec/eng2/egt", 1);
setprop("/systems/fadec/eng2/n2", 1);
setprop("/systems/fadec/eng2/ff", 1);
} else {
setprop("/systems/fadec/eng2/n1", 0);
setprop("/systems/fadec/eng2/egt", 0);
setprop("/systems/fadec/eng2/n2", 0);
setprop("/systems/fadec/eng2/ff", 0);
}
},
};

View file

@ -21,126 +21,174 @@ setprop("/systems/fadec/eng2/ff", 1);
setprop("/systems/fadec/power-avail", 0); setprop("/systems/fadec/power-avail", 0);
setprop("/systems/fadec/powered1", 0); setprop("/systems/fadec/powered1", 0);
setprop("/systems/fadec/powered2", 0); setprop("/systems/fadec/powered2", 0);
setprop("/systems/fadec/powered-time", 0); setprop("/systems/fadec/powered-time", -300);
setprop("/systems/fadec/powerup", 0); setprop("/systems/fadec/powerup", 0);
setprop("/systems/fadec/eng1-master-count", 0);
setprop("/systems/fadec/eng1-master-time", -300);
setprop("/systems/fadec/eng1-off-power", 0);
setprop("/systems/fadec/eng2-master-count", 0);
setprop("/systems/fadec/eng2-master-time", -300);
setprop("/systems/fadec/eng2-off-power", 0);
var fadecLoop = func { var FADEC = {
var ac1 = getprop("/systems/electrical/bus/ac1"); init: func() {
var ac2 = getprop("/systems/electrical/bus/ac2"); setprop("/systems/fadec/powered-time", 0);
var acess = getprop("/systems/electrical/bus/ac-ess"); setprop("/systems/fadec/eng1-master-time", -300);
var state1 = getprop("/engines/engine[0]/state"); setprop("/systems/fadec/eng2-master-time", -300);
var state2 = getprop("/engines/engine[1]/state"); },
var master1 = getprop("/controls/engines/engine[0]/cutoff-switch"); loop: func() {
var master2 = getprop("/controls/engines/engine[1]/cutoff-switch"); var ac1 = getprop("/systems/electrical/bus/ac1");
var modeSel = getprop("/controls/engines/engine-start-switch"); var ac2 = getprop("/systems/electrical/bus/ac2");
var N1Mode1_sw = getprop("/controls/fadec/n1mode1"); var acess = getprop("/systems/electrical/bus/ac-ess");
var N1Mode2_sw = getprop("/controls/fadec/n1mode2"); var state1 = getprop("/engines/engine[0]/state");
var state2 = getprop("/engines/engine[1]/state");
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) { var master1 = getprop("/controls/engines/engine[0]/cutoff-switch");
if (getprop("/systems/fadec/power-avail") != 1) { var master2 = getprop("/controls/engines/engine[1]/cutoff-switch");
setprop("/systems/fadec/powered-time", getprop("/sim/time/elapsed-sec")); var modeSel = getprop("/controls/engines/engine-start-switch");
setprop("/systems/fadec/power-avail", 1); var N1Mode1_sw = getprop("/controls/fadec/n1mode1");
var N1Mode2_sw = getprop("/controls/fadec/n1mode2");
var elapsedSec = getprop("/sim/time/elapsed-sec");
if (ac1 >= 110 or ac2 >= 110 or acess >= 110) {
if (getprop("/systems/fadec/power-avail") != 1) {
setprop("/systems/fadec/powered-time", elapsedSec);
setprop("/systems/fadec/power-avail", 1);
}
} else {
if (getprop("/systems/fadec/power-avail") != 0) {
setprop("/systems/fadec/power-avail", 0);
}
} }
} else {
if (getprop("/systems/fadec/power-avail") != 0) { var powerAvail = getprop("/systems/fadec/power-avail");
setprop("/systems/fadec/power-avail", 0);
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/powerup", 1);
} else {
setprop("/systems/fadec/powerup", 0);
} }
}
if (master1 == 1) {
var powerAvail = getprop("/systems/fadec/power-avail"); if (getprop("/systems/fadec/eng1-master-count") != 1) {
setprop("/systems/fadec/eng1-master-time", elapsedSec);
if (getprop("/systems/fadec/powered-time") + 300 >= getprop("/sim/time/elapsed-sec")) { setprop("/systems/fadec/eng1-master-count", 1);
setprop("/systems/fadec/powerup", 1); }
} else { } else {
setprop("/systems/fadec/powerup", 0); if (getprop("/systems/fadec/eng1-master-count") != 0) {
} setprop("/systems/fadec/eng1-master-count", 0);
}
if (state1 == 3) { }
setprop("/systems/fadec/powered1", 1);
} else if (powerAvail and modeSel == 2) { if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
setprop("/systems/fadec/powered1", 1); setprop("/systems/fadec/eng1-off-power", 1);
} else { } else {
setprop("/systems/fadec/powered1", 0); setprop("/systems/fadec/eng1-off-power", 0);
} }
if (state2 == 3) { if (master2 == 1) {
setprop("/systems/fadec/powered2", 1); if (getprop("/systems/fadec/eng2-master-count") != 1) {
} else if (powerAvail and modeSel == 2) { setprop("/systems/fadec/eng2-master-time", elapsedSec);
setprop("/systems/fadec/powered2", 1); setprop("/systems/fadec/eng2-master-count", 1);
} else { }
setprop("/systems/fadec/powered2", 0); } else {
} if (getprop("/systems/fadec/eng2-master-count") != 0) {
setprop("/systems/fadec/eng2-master-count", 0);
if (N1Mode1_sw == 1) { }
setprop("/systems/fadec/n1mode1", 1); }
} else {
setprop("/systems/fadec/n1mode1", 0); if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
} setprop("/systems/fadec/eng2-off-power", 1);
} else {
if (N1Mode2_sw == 1) { setprop("/systems/fadec/eng2-off-power", 0);
setprop("/systems/fadec/n1mode2", 1); }
} else {
setprop("/systems/fadec/n1mode2", 0); if (state1 == 3) {
} setprop("/systems/fadec/powered1", 1);
} else if (powerAvail and modeSel == 2) {
var powered1 = getprop("/systems/fadec/powered1"); setprop("/systems/fadec/powered1", 1);
var powered2 = getprop("/systems/fadec/powered2"); } else {
var N1Mode1 = getprop("/systems/fadec/n1mode1"); setprop("/systems/fadec/powered1", 0);
var N1Mode2 = getprop("/systems/fadec/n1mode2"); }
var N11 = getprop("/engines/engine[0]/n1-actual");
var N12 = getprop("/engines/engine[1]/n1-actual"); if (state2 == 3) {
var N21 = getprop("/engines/engine[0]/n2-actual"); setprop("/systems/fadec/powered2", 1);
var N22 = getprop("/engines/engine[1]/n2-actual"); } else if (powerAvail and modeSel == 2) {
setprop("/systems/fadec/powered2", 1);
if ((powered1 or getprop("/systems/fadec/powerup")) and N1Mode1 == 0) { } else {
setprop("/systems/fadec/eng1/epr", 1); setprop("/systems/fadec/powered2", 0);
} else { }
setprop("/systems/fadec/eng1/epr", 0);
} if (N1Mode1_sw == 1) {
setprop("/systems/fadec/n1mode1", 1);
if ((powered2 or getprop("/systems/fadec/powerup")) and N1Mode2 == 0) { } else {
setprop("/systems/fadec/eng2/epr", 1); setprop("/systems/fadec/n1mode1", 0);
} else { }
setprop("/systems/fadec/eng2/epr", 0);
} if (N1Mode2_sw == 1) {
setprop("/systems/fadec/n1mode2", 1);
if (powered1 or getprop("/systems/fadec/powerup")) { } else {
setprop("/systems/fadec/eng1/egt", 1); setprop("/systems/fadec/n1mode2", 0);
setprop("/systems/fadec/eng1/ff", 1); }
} else {
setprop("/systems/fadec/eng1/egt", 0); var powered1 = getprop("/systems/fadec/powered1");
setprop("/systems/fadec/eng1/ff", 0); var powered2 = getprop("/systems/fadec/powered2");
} var N1Mode1 = getprop("/systems/fadec/n1mode1");
var N1Mode2 = getprop("/systems/fadec/n1mode2");
if (powered2 or getprop("/systems/fadec/powerup")) { var N11 = getprop("/engines/engine[0]/n1-actual");
setprop("/systems/fadec/eng2/egt", 1); var N12 = getprop("/engines/engine[1]/n1-actual");
setprop("/systems/fadec/eng2/ff", 1); var N21 = getprop("/engines/engine[0]/n2-actual");
} else { var N22 = getprop("/engines/engine[1]/n2-actual");
setprop("/systems/fadec/eng2/egt", 0);
setprop("/systems/fadec/eng2/ff", 0); if ((powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
} setprop("/systems/fadec/eng1/epr", 1);
} else {
if (powered1 and N11 >= 3.5) { setprop("/systems/fadec/eng1/epr", 0);
setprop("/systems/fadec/eng1/n1", 1); }
} else {
setprop("/systems/fadec/eng1/n1", 0); if ((powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
} setprop("/systems/fadec/eng2/epr", 1);
} else {
if (powered2 and N12 >= 3.5) { setprop("/systems/fadec/eng2/epr", 0);
setprop("/systems/fadec/eng2/n1", 1); }
} else {
setprop("/systems/fadec/eng2/n1", 0); if (powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
} setprop("/systems/fadec/eng1/egt", 1);
setprop("/systems/fadec/eng1/ff", 1);
if (powered1 and N21 >= 3.5) { } else {
setprop("/systems/fadec/eng1/n2", 1); setprop("/systems/fadec/eng1/egt", 0);
} else { setprop("/systems/fadec/eng1/ff", 0);
setprop("/systems/fadec/eng1/n2", 0); }
}
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
if (powered2 and N22 >= 3.5) { setprop("/systems/fadec/eng2/egt", 1);
setprop("/systems/fadec/eng2/n2", 1); setprop("/systems/fadec/eng2/ff", 1);
} else { } else {
setprop("/systems/fadec/eng2/n2", 0); setprop("/systems/fadec/eng2/egt", 0);
} setprop("/systems/fadec/eng2/ff", 0);
} }
if (powered1 and N11 >= 3.5) {
setprop("/systems/fadec/eng1/n1", 1);
} else {
setprop("/systems/fadec/eng1/n1", 0);
}
if (powered2 and N12 >= 3.5) {
setprop("/systems/fadec/eng2/n1", 1);
} else {
setprop("/systems/fadec/eng2/n1", 0);
}
if (powered1 and N21 >= 3.5) {
setprop("/systems/fadec/eng1/n2", 1);
} else {
setprop("/systems/fadec/eng1/n2", 0);
}
if (powered2 and N22 >= 3.5) {
setprop("/systems/fadec/eng2/n2", 1);
} else {
setprop("/systems/fadec/eng2/n2", 0);
}
},
};

View file

@ -125,7 +125,7 @@ var HYD = {
setprop("/systems/hydraulic/ptu-active", 0); setprop("/systems/hydraulic/ptu-active", 0);
} }
if ((rat_man_sw == 1 or getprop("/controls/electrical/switches/emer-gen") == 1) and gs > 100) { if ((rat_man_sw == 1 or getprop("/controls/electrical/switches/emer-gen") == 1) and gs >= 100) {
setprop("/controls/hydraulic/rat", 1); setprop("/controls/hydraulic/rat", 1);
setprop("/controls/hydraulic/rat-deployed", 1); setprop("/controls/hydraulic/rat-deployed", 1);
} else if (gs < 100) { } else if (gs < 100) {

View file

@ -16,9 +16,6 @@ setprop("/controls/lighting/ndl-norm", 1);
setprop("/controls/lighting/ndr-norm", 1); setprop("/controls/lighting/ndr-norm", 1);
setprop("/controls/lighting/upper-norm", 1); setprop("/controls/lighting/upper-norm", 1);
# Surprise
setprop("/controls/tray/surprise", 1);
# Lights # Lights
setprop("/sim/model/lights/nose-lights", 0); setprop("/sim/model/lights/nose-lights", 0);
setprop("/sim/model/lights/turnoffsw", 0); setprop("/sim/model/lights/turnoffsw", 0);
@ -180,6 +177,7 @@ var systemsInit = func {
systems.eng_init(); systems.eng_init();
systems.fire_init(); systems.fire_init();
systems.autobrake_init(); systems.autobrake_init();
fadec.FADEC.init();
fmgc.APinit(); fmgc.APinit();
fmgc.FMGCinit(); fmgc.FMGCinit();
mcdu.MCDU_init(0); mcdu.MCDU_init(0);
@ -208,7 +206,7 @@ var systemsLoop = maketimer(0.1, func {
systems.ADIRS.loop(); systems.ADIRS.loop();
libraries.ECAM.loop(); libraries.ECAM.loop();
libraries.BUTTONS.update(); libraries.BUTTONS.update();
fadec.fadecLoop(); fadec.FADEC.loop();
ecam.ECAM_controller.loop(); ecam.ECAM_controller.loop();
if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/switches/cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or getprop("/controls/gear/brake-parking") == 0)) { if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/switches/cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or getprop("/controls/gear/brake-parking") == 0)) {

View file

@ -200,6 +200,7 @@ var PNEU = {
# Air Sources/PSI # Air Sources/PSI
if (rpmapu >= 94.9 and bleedapu_sw and !bleedapu_fail) { if (rpmapu >= 94.9 and bleedapu_sw and !bleedapu_fail) {
setprop("/systems/pneumatic/bleedapu", 34); setprop("/systems/pneumatic/bleedapu", 34);
setprop("/systems/apu/bleed-used", 1);
} else { } else {
setprop("/systems/pneumatic/bleedapu", 0); setprop("/systems/pneumatic/bleedapu", 0);
} }
@ -372,10 +373,10 @@ var PNEU = {
acess = getprop("/systems/electrical/bus/ac-ess"); acess = getprop("/systems/electrical/bus/ac-ess");
fanon = getprop("/systems/ventilation/avionics/fan"); fanon = getprop("/systems/ventilation/avionics/fan");
if ((dcess > 25) or (acess > 110)) { if (dcess > 25 or acess > 110) {
setprop("/systems/ventilation/avionics/fan", 1); setprop("/systems/ventilation/avionics/fan", 1);
setprop("/systems/ventilation/lavatory/extractfan", 1); setprop("/systems/ventilation/lavatory/extractfan", 1);
} else if ((dcess == 0) and (acess == 0)) { } else if (dcess == 0 and acess == 0) {
setprop("/systems/ventilation/avionics/fan", 0); setprop("/systems/ventilation/avionics/fan", 0);
setprop("/systems/ventilation/lavatory/extractfan", 0); setprop("/systems/ventilation/lavatory/extractfan", 0);
} }

View file

@ -666,7 +666,6 @@
<default value="0"/> <default value="0"/>
<test logic="AND" value="hydraulics/spoiler-r4/extended"> <test logic="AND" value="hydraulics/spoiler-r4/extended">
/systems/hydraulic/yellow-psi ge 1500 /systems/hydraulic/yellow-psi ge 1500
spoilers/main-gear-and eq 0
/systems/failures/spoiler-r4 eq 0 /systems/failures/spoiler-r4 eq 0
spoilers/main-cmd gt 0 spoilers/main-cmd gt 0
</test> </test>

View file

@ -1 +1 @@
4655 4661