diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index 147f74ec..e58e2939 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -169,8 +169,6 @@ var master_elec = func { extpwr_on = getprop("/controls/switches/cart"); stateL = getprop("/engines/engine[0]/state"); stateR = getprop("/engines/engine[1]/state"); - xtieL = getprop("/controls/electrical/xtie/xtieL"); - xtieR = getprop("/controls/electrical/xtie/xtieR"); ac1 = getprop("/systems/electrical/bus/ac1"); ac2 = getprop("/systems/electrical/bus/ac2"); ac_ess = getprop("/systems/electrical/bus/ac-ess"); @@ -231,16 +229,19 @@ var master_elec = func { setprop("/controls/electrical/xtie/xtieL", 0); } + xtieL = getprop("/controls/electrical/xtie/xtieL"); + xtieR = getprop("/controls/electrical/xtie/xtieR"); + # Left DC bus yes? if (stateL == 3 and gen1_sw and !gen1_fail) { setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); - } else if (extpwr_on and gen_ext_sw) { + } else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); - } else if (gen_apu and !genapu_fail) { + } else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/dc1", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc1-amps", dc_amps_std); @@ -265,11 +266,11 @@ var master_elec = func { setprop("/systems/electrical/bus/dc2", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); - } else if (extpwr_on and gen_ext_sw) { + } else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/dc2", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); - } else if (gen_apu and !genapu_fail) { + } else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/dc2", dc_volt_std); setprop("/systems/electrical/bus/dc-ess", dc_volt_std); setprop("/systems/electrical/bus/dc2-amps", dc_amps_std); @@ -292,9 +293,9 @@ var master_elec = func { # Left AC bus yes? if (stateL == 3 and gen1_sw and !gen1_fail) { setprop("/systems/electrical/bus/ac1", ac_volt_std); - } else if (extpwr_on and gen_ext_sw) { + } else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac1", ac_volt_std); - } else if (gen_apu and !genapu_fail) { + } else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac1", ac_volt_std); } else if (apu_ext_crosstie_sw == 1 and xtieL) { setprop("/systems/electrical/bus/ac1", ac_volt_std); @@ -307,9 +308,9 @@ var master_elec = func { # Right AC bus yes? if (stateR == 3 and gen2_sw and !gen2_fail) { setprop("/systems/electrical/bus/ac2", ac_volt_std); - } else if (extpwr_on and gen_ext_sw) { + } else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac2", ac_volt_std); - } else if (gen_apu and !genapu_fail) { + } else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) { setprop("/systems/electrical/bus/ac2", ac_volt_std); } else if (apu_ext_crosstie_sw == 1 and xtieR) { setprop("/systems/electrical/bus/ac2", ac_volt_std); diff --git a/Nasal/fuel.nas b/Nasal/fuel.nas index d486cc33..a73052af 100644 --- a/Nasal/fuel.nas +++ b/Nasal/fuel.nas @@ -160,7 +160,7 @@ var master_fuel = func { gravityfeedL = getprop("/systems/fuel/gravityfeedL"); gravityfeedR = getprop("/systems/fuel/gravityfeedR"); - if ((getprop("/fdm/jsbsim/propulsion/tank[1]/contents-lbs") >= 50) and tank1feed0 and tank1feed1 and !gravityfeedL and !gravityfeedR) { + if ((getprop("/fdm/jsbsim/propulsion/tank[1]/contents-lbs") >= 50) and tank1feed and !gravityfeedL and !gravityfeedR) { setprop("/systems/fuel/only-use-ctr-tank", 1); } else { setprop("/systems/fuel/only-use-ctr-tank", 0); diff --git a/revision.txt b/revision.txt index 8799d84b..e8dadcda 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -1537 \ No newline at end of file +1540 \ No newline at end of file