System: something
This commit is contained in:
parent
ecb240de3d
commit
7862ae1b89
1 changed files with 22 additions and 22 deletions
|
@ -380,31 +380,31 @@ var ELEC = {
|
|||
setprop("/systems/electrical/bus/dc1", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr1-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr1-amps", tr_amps_std);
|
||||
} 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/extra/tr1-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr1-amps", tr_amps_std);
|
||||
} 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/extra/tr1-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr1-amps", tr_amps_std);
|
||||
} else if (apu_ext_crosstie_sw == 1 and xtieL) {
|
||||
setprop("/systems/electrical/bus/dc1", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr1-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc1-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr1-amps", tr_amps_std);
|
||||
} else if (emergen) {
|
||||
setprop("/systems/electrical/bus/dc1", 0);
|
||||
setprop("/systems/electrical/bus/dc-ess", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr1-volts", 0);
|
||||
setprop("/systems/electrical/bus/dc1-amps", 0);
|
||||
setprop("/systems/electrical/bus/dc1-amps", 0);
|
||||
setprop("/systems/electrical/extra/tr1-amps", 0);
|
||||
} else if (dcbat and ias >= 50) {
|
||||
setprop("/systems/electrical/bus/dc1", 0);
|
||||
|
@ -415,8 +415,8 @@ var ELEC = {
|
|||
} else {
|
||||
setprop("/systems/electrical/bus/dc1", 0);
|
||||
setprop("/systems/electrical/extra/tr1-volts", 0);
|
||||
setprop("/systems/electrical/bus/dc1-amps", 0);
|
||||
setprop("/systems/electrical/extra/tr1-amps", 0);
|
||||
setprop("/systems/electrical/bus/dc1-amps", 0);
|
||||
setprop("/systems/electrical/extra/tr1-amps", 0);
|
||||
setprop("/systems/electrical/bus/dc-ess", 0);
|
||||
}
|
||||
|
||||
|
@ -424,37 +424,37 @@ var ELEC = {
|
|||
if (stateR == 3 and gen2_sw and !gen2_fail) {
|
||||
setprop("/systems/electrical/bus/dc2", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr2-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr2-amps", tr_amps_std);
|
||||
} else if (extpwr_on and gen_ext_sw and apu_ext_crosstie_sw) {
|
||||
setprop("/systems/electrical/bus/dc2", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr2-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr2-amps", tr_amps_std);
|
||||
} else if (gen_apu and !genapu_fail and apu_ext_crosstie_sw) {
|
||||
setprop("/systems/electrical/bus/dc2", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr2-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr2-amps", tr_amps_std);
|
||||
} else if (apu_ext_crosstie_sw == 1 and xtieR) {
|
||||
setprop("/systems/electrical/bus/dc2", dc_volt_std);
|
||||
setprop("/systems/electrical/extra/tr2-volts", dc_volt_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/bus/dc2-amps", dc_amps_std);
|
||||
setprop("/systems/electrical/extra/tr2-amps", tr_amps_std);
|
||||
} else if (emergen) {
|
||||
setprop("/systems/electrical/bus/dc2", 0);
|
||||
setprop("/systems/electrical/extra/tr2-volts", 0);
|
||||
setprop("/systems/electrical/bus/dc2-amps", 0);
|
||||
setprop("/systems/electrical/bus/dc2-amps", 0);
|
||||
setprop("/systems/electrical/extra/tr2-amps", 0);
|
||||
} else if (dcbat and ias >= 50) {
|
||||
setprop("/systems/electrical/bus/dc2", 0);
|
||||
setprop("/systems/electrical/extra/tr2-volts", 0);
|
||||
setprop("/systems/electrical/bus/dc2-amps", 0);
|
||||
setprop("/systems/electrical/bus/dc2-amps", 0);
|
||||
setprop("/systems/electrical/extra/tr2-amps", 0);
|
||||
} else {
|
||||
setprop("/systems/electrical/bus/dc2", 0);
|
||||
setprop("/systems/electrical/extra/tr2-volts", 0);
|
||||
setprop("/systems/electrical/bus/dc2-amps", 0);
|
||||
setprop("/systems/electrical/bus/dc2-amps", 0);
|
||||
setprop("/systems/electrical/extra/tr2-amps", 0);
|
||||
}
|
||||
|
||||
|
@ -576,9 +576,9 @@ var ELEC = {
|
|||
}
|
||||
|
||||
if (!gen_apu and !gen_ext_sw and (!gen1_sw or !gen2_sw)) {
|
||||
setprop("/systems/electrical/extra/galleyshed", 1);
|
||||
setprop("/systems/electrical/extra/galleyshed", 1);
|
||||
} else {
|
||||
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) {
|
||||
|
@ -602,12 +602,12 @@ var ELEC = {
|
|||
|
||||
if (battery1_volts < 27.9 and (dc1 > 25 or dc2 > 25) and battery1_sw and !batt1_fail) {
|
||||
if (getprop("/systems/electrical/battery1-time") + 60 < getprop("/sim/time/elapsed-sec")) {
|
||||
setprop("/systems/electrical/battery1-volts", battery1_volts + 0.02877666); # Roughly 15mins to 25.9
|
||||
setprop("/systems/electrical/battery1-volts", battery1_volts + 0.02877666);# Roughly 15mins to 25.9
|
||||
setprop("/systems/electrical/battery1-time", getprop("/sim/time/elapsed-sec"));
|
||||
}
|
||||
} else if (battery1_sw and !batt1_fail) {
|
||||
if (getprop("/systems/electrical/battery1-time") + 60 < getprop("/sim/time/elapsed-sec")) {
|
||||
setprop("/systems/electrical/battery1-volts", battery1_volts - 0.01438833); # Roughly 30mins from 25.9
|
||||
setprop("/systems/electrical/battery1-volts", battery1_volts - 0.01438833);# Roughly 30mins from 25.9
|
||||
setprop("/systems/electrical/battery1-time", getprop("/sim/time/elapsed-sec"));
|
||||
}
|
||||
} else {
|
||||
|
@ -616,12 +616,12 @@ var ELEC = {
|
|||
|
||||
if (battery2_volts < 27.9 and (dc1 > 25 or dc2 > 25) and battery2_sw and !batt2_fail) {
|
||||
if (getprop("/systems/electrical/battery2-time") + 60 < getprop("/sim/time/elapsed-sec")) {
|
||||
setprop("/systems/electrical/battery2-volts", battery2_volts + 0.02877666); # Roughly 15mins to 25.9
|
||||
setprop("/systems/electrical/battery2-volts", battery2_volts + 0.02877666);# Roughly 15mins to 25.9
|
||||
setprop("/systems/electrical/battery2-time", getprop("/sim/time/elapsed-sec"));
|
||||
}
|
||||
} else if (battery2_sw and !batt2_fail) {
|
||||
if (getprop("/systems/electrical/battery2-time") + 60 < getprop("/sim/time/elapsed-sec")) {
|
||||
setprop("/systems/electrical/battery2-volts", battery2_volts - 0.01438833); # Roughly 30mins from 25.9
|
||||
setprop("/systems/electrical/battery2-volts", battery2_volts - 0.01438833);# Roughly 30mins from 25.9
|
||||
setprop("/systems/electrical/battery2-time", getprop("/sim/time/elapsed-sec"));
|
||||
}
|
||||
} else {
|
||||
|
@ -762,7 +762,7 @@ var ELEC = {
|
|||
setprop("/controls/ventilation/blowFail", 0);
|
||||
}
|
||||
|
||||
foreach(var screena; screens) {
|
||||
foreach(var screena;screens) {
|
||||
power_consumption = screena.power_consumption();
|
||||
if (getprop(screena.elec_prop) != 0) {
|
||||
setprop("/systems/electrical/DU/" ~ screena.name ~ "/watts", power_consumption);
|
||||
|
@ -771,7 +771,7 @@ var ELEC = {
|
|||
}
|
||||
}
|
||||
|
||||
foreach(var lighta; lights) {
|
||||
foreach(var lighta;lights) {
|
||||
power_consumption = lighta.power_consumption();
|
||||
if (getprop(lighta.elec_prop) != 0 and getprop(lighta.control_prop) != 0) {
|
||||
setprop("/systems/electrical/light/" ~ lighta.name ~ "/watts", power_consumption);
|
||||
|
|
Reference in a new issue