A320 Electrical system: push an entirely new battery logic and connections
This commit is contained in:
parent
3f9852d0f0
commit
75b874d2a9
5 changed files with 1031 additions and 865 deletions
|
@ -113,8 +113,8 @@ var relayExt = func {
|
||||||
settimer(func {setprop("/sim/sounde/relay-ext",0);},0.35);
|
settimer(func {setprop("/sim/sounde/relay-ext",0);},0.35);
|
||||||
}
|
}
|
||||||
|
|
||||||
setlistener("/systems/electrical/sources/bat-1/contact", relayBatt1, nil, 0);
|
setlistener("/systems/electrical/sources/bat-1/bcl-supply", relayBatt1, nil, 0);
|
||||||
setlistener("/systems/electrical/sources/bat-2/contact", relayBatt2, nil, 0);
|
setlistener("/systems/electrical/sources/bat-2/bcl-supply", relayBatt2, nil, 0);
|
||||||
setlistener("/systems/electrical/relay/apu-glc/contact-pos", relayApu, nil, 0);
|
setlistener("/systems/electrical/relay/apu-glc/contact-pos", relayApu, nil, 0);
|
||||||
setlistener("/systems/electrical/relay/ext-epc/contact-pos", relayExt, nil, 0);
|
setlistener("/systems/electrical/relay/ext-epc/contact-pos", relayExt, nil, 0);
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ var APU = {
|
||||||
bleedTime: 0,
|
bleedTime: 0,
|
||||||
cooldownEndTime: 0,
|
cooldownEndTime: 0,
|
||||||
fastStart: 0,
|
fastStart: 0,
|
||||||
|
inhibitEMERELEC: 0,
|
||||||
_count: 0,
|
_count: 0,
|
||||||
warnings: {
|
warnings: {
|
||||||
lowOilLevel: 0,
|
lowOilLevel: 0,
|
||||||
|
@ -62,6 +63,7 @@ var APU = {
|
||||||
me.signals.fault.setValue(0);
|
me.signals.fault.setValue(0);
|
||||||
me.signals.autoshutdown = 0;
|
me.signals.autoshutdown = 0;
|
||||||
me.signals.emer = 0;
|
me.signals.emer = 0;
|
||||||
|
me.inhibitEMERELEC = 0;
|
||||||
checkApuStartTimer.stop();
|
checkApuStartTimer.stop();
|
||||||
apuStartTimer.stop();
|
apuStartTimer.stop();
|
||||||
apuStartTimer2.stop();
|
apuStartTimer2.stop();
|
||||||
|
@ -119,7 +121,7 @@ var APU = {
|
||||||
if (me.fastStart) {
|
if (me.fastStart) {
|
||||||
me.inletFlap.setpos(1);
|
me.inletFlap.setpos(1);
|
||||||
}
|
}
|
||||||
if (pts.APU.rpm.getValue() < 7 and me.fuelValvePos.getValue() and me.inletFlapPos.getValue() == 1 and me.signals.oilTestComplete and !me.warnings.lowOilLevel) {
|
if (pts.APU.rpm.getValue() < 7 and me.fuelValvePos.getValue() and me.inletFlapPos.getValue() == 1 and me.signals.oilTestComplete and !me.warnings.lowOilLevel and !me.inhibitEMERELEC) {
|
||||||
me.setState(4);
|
me.setState(4);
|
||||||
me.listenStopSignal = 1;
|
me.listenStopSignal = 1;
|
||||||
checkApuStartTimer.stop();
|
checkApuStartTimer.stop();
|
||||||
|
@ -270,6 +272,7 @@ var APU = {
|
||||||
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
|
if (me.state == 5 and APUNodes.Oil.pressure.getValue() < 35 or APUNodes.Oil.temperature.getValue() > 135) {
|
||||||
me.autoStop();
|
me.autoStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
if (systems.ELEC.Bus.dcBat.getValue() < 25) {
|
||||||
if (!me._powerLost) {
|
if (!me._powerLost) {
|
||||||
me._powerLost = 1;
|
me._powerLost = 1;
|
||||||
|
@ -287,6 +290,12 @@ var APU = {
|
||||||
} else {
|
} else {
|
||||||
me._powerLost = 0;
|
me._powerLost = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (systems.ELEC.EmerElec.getValue() == 1 and (systems.ELEC.EmerElec45.getValue() != 1 and systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110)) {
|
||||||
|
me.inhibitEMERELEC = 1;
|
||||||
|
} else {
|
||||||
|
me.inhibitEMERELEC = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,7 @@ var dc2 = 0;
|
||||||
# Main class
|
# Main class
|
||||||
var ELEC = {
|
var ELEC = {
|
||||||
EmerElec: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config"),
|
EmerElec: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config"),
|
||||||
|
EmerElec45: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config-45"),
|
||||||
Bus: {
|
Bus: {
|
||||||
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
|
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
|
||||||
acEssShed: props.globals.getNode("/systems/electrical/bus/ac-ess-shed"),
|
acEssShed: props.globals.getNode("/systems/electrical/bus/ac-ess-shed"),
|
||||||
|
@ -79,11 +80,11 @@ var ELEC = {
|
||||||
acTie1: props.globals.getNode("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos"),
|
acTie1: props.globals.getNode("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos"),
|
||||||
acTie2: props.globals.getNode("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"),
|
acTie2: props.globals.getNode("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"),
|
||||||
apuGlc: props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos"),
|
apuGlc: props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos"),
|
||||||
dcEssFeedBat: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-bat/contact-pos"),
|
dcEssFeedBat: props.globals.getNode("/systems/electrical/relay/dc-bat-tie-dc-ess/contact-pos"),
|
||||||
essTrContactor: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/contact-pos"),
|
essTrContactor: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/contact-pos"),
|
||||||
extEpc: props.globals.getNode("/systems/electrical/relay/ext-epc/contact-pos"),
|
extEpc: props.globals.getNode("/systems/electrical/relay/ext-epc/contact-pos"),
|
||||||
dcTie1: props.globals.getNode("/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos"),
|
dcTie1: props.globals.getNode("/systems/electrical/relay/dc-bat-tie-dc-1/contact-pos"),
|
||||||
dcTie2: props.globals.getNode("/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos"),
|
dcTie2: props.globals.getNode("/systems/electrical/relay/dc-bat-tie-dc-2/contact-pos"),
|
||||||
glc1: props.globals.getNode("/systems/electrical/relay/gen-1-glc/contact-pos"),
|
glc1: props.globals.getNode("/systems/electrical/relay/gen-1-glc/contact-pos"),
|
||||||
glc2: props.globals.getNode("/systems/electrical/relay/gen-2-glc/contact-pos"),
|
glc2: props.globals.getNode("/systems/electrical/relay/gen-2-glc/contact-pos"),
|
||||||
tr1Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/contact-pos"),
|
tr1Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/contact-pos"),
|
||||||
|
@ -103,7 +104,7 @@ var ELEC = {
|
||||||
Bat1: {
|
Bat1: {
|
||||||
volt: props.globals.getNode("/systems/electrical/sources/bat-1/volt"),
|
volt: props.globals.getNode("/systems/electrical/sources/bat-1/volt"),
|
||||||
amps: props.globals.getNode("/systems/electrical/sources/bat-1/amps"),
|
amps: props.globals.getNode("/systems/electrical/sources/bat-1/amps"),
|
||||||
contact: props.globals.getNode("/systems/electrical/sources/bat-1/contact"),
|
contact: props.globals.getNode("/systems/electrical/sources/bat-1/bcl-supply"),
|
||||||
percent: props.globals.getNode("/systems/electrical/sources/bat-1/percent"),
|
percent: props.globals.getNode("/systems/electrical/sources/bat-1/percent"),
|
||||||
direction: props.globals.getNode("/systems/electrical/sources/bat-1/direction"),
|
direction: props.globals.getNode("/systems/electrical/sources/bat-1/direction"),
|
||||||
time: props.globals.getNode("/systems/electrical/sources/bat-1/time"),
|
time: props.globals.getNode("/systems/electrical/sources/bat-1/time"),
|
||||||
|
@ -111,7 +112,7 @@ var ELEC = {
|
||||||
Bat2: {
|
Bat2: {
|
||||||
volt: props.globals.getNode("/systems/electrical/sources/bat-2/volt"),
|
volt: props.globals.getNode("/systems/electrical/sources/bat-2/volt"),
|
||||||
amps: props.globals.getNode("/systems/electrical/sources/bat-2/amps"),
|
amps: props.globals.getNode("/systems/electrical/sources/bat-2/amps"),
|
||||||
contact: props.globals.getNode("/systems/electrical/sources/bat-2/contact"),
|
contact: props.globals.getNode("/systems/electrical/sources/bat-2/bcl-supply"),
|
||||||
percent: props.globals.getNode("/systems/electrical/sources/bat-2/percent"),
|
percent: props.globals.getNode("/systems/electrical/sources/bat-2/percent"),
|
||||||
direction: props.globals.getNode("/systems/electrical/sources/bat-2/direction"),
|
direction: props.globals.getNode("/systems/electrical/sources/bat-2/direction"),
|
||||||
time: props.globals.getNode("/systems/electrical/sources/bat-2/time"),
|
time: props.globals.getNode("/systems/electrical/sources/bat-2/time"),
|
||||||
|
@ -135,10 +136,10 @@ var ELEC = {
|
||||||
outputAmp: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output-amp"),
|
outputAmp: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output-amp"),
|
||||||
},
|
},
|
||||||
trEss: {
|
trEss: {
|
||||||
outputVolt: props.globals.getNode("/systems/electrical/sources/tr-ess/output-volt"),
|
outputVolt: props.globals.getNode("/systems/electrical/sources/ess-tr/output-volt"),
|
||||||
outputAmp: props.globals.getNode("/systems/electrical/sources/tr-ess/output-amp"),
|
outputAmp: props.globals.getNode("/systems/electrical/sources/ess-tr/output-amp"),
|
||||||
outputVoltRelay: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output"),
|
outputVoltRelay: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/output"),
|
||||||
outputAmpRelay: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output-amp"),
|
outputAmpRelay: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/output-amp"),
|
||||||
},
|
},
|
||||||
IDG1: {
|
IDG1: {
|
||||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),
|
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -363,7 +363,7 @@
|
||||||
<test logic="AND" value="1">
|
<test logic="AND" value="1">
|
||||||
<test logic="OR">
|
<test logic="OR">
|
||||||
/systems/electrical/bus/dc-2 ge 25
|
/systems/electrical/bus/dc-2 ge 25
|
||||||
/systems/electrical/relay/dc-ess-feed-bat/contact-pos eq 1
|
/systems/electrical/relay/dc-bat-tie-dc-ess/contact-pos eq 1
|
||||||
</test>
|
</test>
|
||||||
<test logic="OR">
|
<test logic="OR">
|
||||||
<test logic="AND">
|
<test logic="AND">
|
||||||
|
|
Loading…
Reference in a new issue