Control: bugfix ground interaction
This commit is contained in:
parent
c2f3901f72
commit
8da59fe409
23 changed files with 125 additions and 120 deletions
|
@ -553,6 +553,7 @@
|
|||
<!-- Multiplayer properties -->
|
||||
<multiplay>
|
||||
<generic>
|
||||
<bool n="0" alias="/services/chocks/enable"/>
|
||||
<float n="0" alias="/controls/lighting/dome-norm"/>
|
||||
<float n="1" alias="/gear/gear[0]/steering-norm"/>
|
||||
<float n="2" alias="/engines/engine[0]/reverser-pos-norm"/>
|
||||
|
@ -721,7 +722,7 @@
|
|||
</control-2>
|
||||
<eng-out type="bool">0</eng-out>
|
||||
<limit n="0">
|
||||
<active-mode type="string">T/O</active-mode>
|
||||
<active-mode type="string">TOGA</active-mode>
|
||||
<active-mode-int type="int">0</active-mode-int>
|
||||
<flex-active type="bool">0</flex-active>
|
||||
<flex-active-cmd type="bool">0</flex-active-cmd>
|
||||
|
@ -876,7 +877,6 @@
|
|||
<avionics-switch type="bool">true</avionics-switch>
|
||||
</electric>
|
||||
<electrical>
|
||||
<ground-cart type="bool">0</ground-cart>
|
||||
<switches n="0">
|
||||
<apu type="bool">1</apu>
|
||||
<ac-ess-feed type="bool">1</ac-ess-feed>
|
||||
|
@ -889,6 +889,7 @@
|
|||
<gen-1 type="bool">1</gen-1>
|
||||
<gen-2 type="bool">1</gen-2>
|
||||
<gen-1-line-contactor type="bool">0</gen-1-line-contactor>
|
||||
<ground-cart type="bool">0</ground-cart>
|
||||
<idg-1-disc type="bool">1</idg-1-disc>
|
||||
<idg-2-disc type="bool">1</idg-2-disc>
|
||||
<idg-1-disc-momentary type="bool">0</idg-1-disc-momentary>
|
||||
|
@ -984,10 +985,10 @@
|
|||
</fuel>
|
||||
<gear>
|
||||
<brake-fans type="bool">0</brake-fans>
|
||||
<brake-parking type="bool">1</brake-parking>
|
||||
<brake-parking type="bool">0</brake-parking>
|
||||
<nws-switch type="double">1</nws-switch>
|
||||
<tiller-cmd-norm type="double">0</tiller-cmd-norm>
|
||||
<tiller-enabled type="bool">0</tiller-enabled>
|
||||
<nws-switch type="double">1</nws-switch>
|
||||
</gear>
|
||||
<hydraulic>
|
||||
<switches>
|
||||
|
@ -1132,21 +1133,20 @@
|
|||
<blower type="bool">0</blower>
|
||||
<cabin-fans type="bool">0</cabin-fans>
|
||||
<extract type="bool">0</extract>
|
||||
<groundair type="bool">0</groundair>
|
||||
<ground-air type="bool">0</ground-air>
|
||||
<hot-air type="bool">1</hot-air>
|
||||
<pack-1 type="bool">0</pack-1>
|
||||
<pack-2 type="bool">0</pack-2>
|
||||
<pack-flow type="double">1.0</pack-flow>
|
||||
<pack-flow type="double">1</pack-flow>
|
||||
<ram-air type="bool">0</ram-air>
|
||||
<temp-cabin-aft type="double">0.5</temp-cabin-aft>
|
||||
<temp-cabin-fwd type="double">0.5</temp-cabin-fwd>
|
||||
<temp-cockpit type="double">0.5</temp-cockpit>
|
||||
<x-bleed type="int">1</x-bleed> <!-- auto -->
|
||||
<x-bleed type="int">1</x-bleed> <!-- Auto -->
|
||||
</switches>
|
||||
</pneumatics>
|
||||
<switches>
|
||||
<!-- Smoking is bad :P -->
|
||||
<no-smoking-sign type="double">0.5</no-smoking-sign>
|
||||
<no-smoking-sign type="double">0.5</no-smoking-sign> <!-- Smoking is bad :P -->
|
||||
<seatbelt-sign type="double">0.0</seatbelt-sign>
|
||||
<annun-test type="int">0</annun-test>
|
||||
<qnh-knb>100000</qnh-knb>
|
||||
|
@ -1253,7 +1253,7 @@
|
|||
|
||||
<services n="0">
|
||||
<chocks n="0">
|
||||
<enable type="bool">0</enable>
|
||||
<enable type="bool">1</enable>
|
||||
</chocks>
|
||||
<fuel-truck>
|
||||
<connect type="bool">0</connect>
|
||||
|
|
|
@ -21,10 +21,10 @@ var spinning = maketimer(0.05, func {
|
|||
});
|
||||
|
||||
var failReset = func {
|
||||
systems.ELEC.resetFail();
|
||||
systems.PNEU.resetFail();
|
||||
fbw.FBW.resetFail();
|
||||
systems.HYD.resetFail();
|
||||
systems.ELEC.resetFailures();
|
||||
systems.PNEU.resetFailures();
|
||||
fbw.FBW.resetFailures();
|
||||
systems.HYD.resetFailures();
|
||||
}
|
||||
|
||||
var failResetOld = func {
|
||||
|
@ -91,6 +91,10 @@ var current_revision = io.readfile(revisionFile);
|
|||
print("A320-family Revision: " ~ current_revision);
|
||||
setprop("/systems/acconfig/revision", current_revision);
|
||||
|
||||
var SYSTEM = { # Prepare for migration to ACCONFIG V2
|
||||
autoConfigRunning: props.globals.getNode("/systems/acconfig/autoconfig-running"),
|
||||
};
|
||||
|
||||
var foViewNode = props.globals.initNode("/systems/acconfig/options/fo-view", 0, "BOOL");
|
||||
setprop("/systems/acconfig/options/simbrief-username", "");
|
||||
|
||||
|
@ -268,6 +272,7 @@ var colddark = func {
|
|||
setprop("/controls/gear/brake-left", 1);
|
||||
setprop("/controls/gear/brake-right", 1);
|
||||
# Initial shutdown, and reinitialization.
|
||||
setprop("/services/chocks/enable", 1);
|
||||
setprop("/controls/engines/engine-start-switch", 1);
|
||||
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
|
||||
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
|
||||
|
@ -327,6 +332,7 @@ var beforestart = func {
|
|||
setprop("/controls/gear/brake-left", 1);
|
||||
setprop("/controls/gear/brake-right", 1);
|
||||
# First, we set everything to cold and dark.
|
||||
setprop("/services/chocks/enable", 1);
|
||||
setprop("/controls/engines/engine-start-switch", 1);
|
||||
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
|
||||
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
|
||||
|
@ -423,6 +429,7 @@ var taxi = func {
|
|||
setprop("/controls/gear/brake-left", 1);
|
||||
setprop("/controls/gear/brake-right", 1);
|
||||
# First, we set everything to cold and dark.
|
||||
setprop("/services/chocks/enable", 0);
|
||||
setprop("/controls/engines/engine-start-switch", 1);
|
||||
setprop("/controls/engines/engine[0]/cutoff-switch", 1);
|
||||
setprop("/controls/engines/engine[1]/cutoff-switch", 1);
|
||||
|
@ -533,7 +540,6 @@ var taxi_d = func {
|
|||
setprop("/controls/engines/engine-start-switch", 1);
|
||||
setprop("/controls/apu/master", 0);
|
||||
setprop("/controls/pneumatics/switches/apu", 0);
|
||||
setprop("/controls/gear/brake-parking", 0);
|
||||
setprop("/controls/gear/brake-left", 0);
|
||||
setprop("/controls/gear/brake-right", 0);
|
||||
setprop("/systems/acconfig/autoconfig-running", 0);
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
<checkbox>
|
||||
<label>Enable External Power Box</label>
|
||||
<halign>left</halign>
|
||||
<property>/controls/electrical/ground-cart</property>
|
||||
<property>/controls/electrical/switches/ground-cart</property>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/controls/electrical/switches/ext-pwr</property>
|
||||
|
@ -138,10 +138,10 @@
|
|||
<checkbox>
|
||||
<label>Enable External Air</label>
|
||||
<halign>left</halign>
|
||||
<property>/controls/pneumatics/switches/groundair</property>
|
||||
<property>/controls/pneumatics/switches/ground-air</property>
|
||||
<binding>
|
||||
<command>property-toggle</command>
|
||||
<property>/controls/pneumatics/switches/groundair</property>
|
||||
<property>/controls/pneumatics/switches/ground-air</property>
|
||||
</binding>
|
||||
<enable>
|
||||
<less-than>
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<path>Aircraft/A320-family/Models/Services/External-Power/ext-pwr-box.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>controls/electrical/ground-cart</property>
|
||||
<property>controls/electrical/switches/ground-cart</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
@ -139,10 +139,7 @@
|
|||
<name>chock_nose</name>
|
||||
<path>Aircraft/A320-family/Models/Services/Chocks/chock_nose.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>services/chocks/enable</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>sim/multiplay/generic/bool[0]</property>
|
||||
</condition>
|
||||
<offsets>
|
||||
<x-m>2.35</x-m>
|
||||
|
@ -154,10 +151,7 @@
|
|||
<name>chock_left</name>
|
||||
<path>Aircraft/A320-family/Models/Services/Chocks/chock_left.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>services/chocks/enable</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>sim/multiplay/generic/bool[0]</property>
|
||||
</condition>
|
||||
<offsets>
|
||||
<x-m>-6.0</x-m>
|
||||
|
@ -170,10 +164,7 @@
|
|||
<name>chock_right</name>
|
||||
<path>Aircraft/A320-family/Models/Services/Chocks/chock_right.ac</path>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>services/chocks/enable</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<property>sim/multiplay/generic/bool[0]</property>
|
||||
</condition>
|
||||
<offsets>
|
||||
<x-m>-6.0</x-m>
|
||||
|
@ -181,9 +172,9 @@
|
|||
<z-m>1.25</z-m>
|
||||
</offsets>
|
||||
</model>
|
||||
|
||||
<!-- Stairways -->
|
||||
|
||||
|
||||
<model>
|
||||
<path>Aircraft/A320-family/Models/Services/Stairs/stairs.xml</path>
|
||||
<name>l1</name>
|
||||
|
|
|
@ -825,7 +825,7 @@ var input = {
|
|||
elecTREssVolt: "/systems/electrical/relay/ess-tr-contactor/output",
|
||||
elecIDG1Disc: "/controls/electrical/switches/idg-1-disc",
|
||||
elecIDG2Disc: "/controls/electrical/switches/idg-2-disc",
|
||||
elecGroundCart: "/controls/electrical/ground-cart",
|
||||
elecGroundCart: "/controls/electrical/switches/ground-cart",
|
||||
elecExtHertz: "/systems/electrical/sources/ext/output-hertz",
|
||||
elecExtVolt: "/systems/electrical/sources/ext/output-volt",
|
||||
elecDCTie1: "/systems/electrical/relay/dc-bat-tie-dc-1/contact-pos",
|
||||
|
|
|
@ -815,7 +815,7 @@ var canvas_MCDU_base = {
|
|||
me["Simple_L6"].setText(" RETURN");
|
||||
pageSwitch[i].setBoolValue(1);
|
||||
}
|
||||
me["Simple_R1S"].setText(sprintf("%-10s",(pts.Controls.Gear.parkingBrake.getValue() == 1) ? "SET" : "RELEASED"));
|
||||
me["Simple_R1S"].setText(sprintf("%-10s",(pts.Controls.Gear.brakeParking.getValue() == 1) ? "SET" : "RELEASED"));
|
||||
me["Simple_R1"].setText(sprintf("%-10s",(pts.Gear.wow[0].getValue() == 1) ? "GROUND" : "FLIGHT"));
|
||||
me["Simple_R2S"].setText(sprintf("%-10s",(doorL1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
|
||||
me["Simple_R2"].setText(sprintf("%-10s",(doorR1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
|
||||
|
|
|
@ -3491,7 +3491,7 @@
|
|||
<binding>
|
||||
<condition>
|
||||
<equals>
|
||||
<property>controls/electrical/ground-cart</property>
|
||||
<property>controls/electrical/switches/ground-cart</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</condition>
|
||||
|
@ -3511,7 +3511,7 @@
|
|||
<condition>
|
||||
<or>
|
||||
<equals>
|
||||
<property>controls/electrical/ground-cart</property>
|
||||
<property>controls/electrical/switches/ground-cart</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<and>
|
||||
|
|
|
@ -303,7 +303,7 @@ var messages_priority_3 = func {
|
|||
ECAM_controller.warningReset(eng1FireGnlever);
|
||||
}
|
||||
|
||||
if (eng1FireGnparkbrk.clearFlag == 0 and pts.Controls.Gear.parkingBrake.getValue() == 0) {
|
||||
if (eng1FireGnparkbrk.clearFlag == 0 and pts.Controls.Gear.brakeParking.getValue() == 0) {
|
||||
eng1FireGnstopped.active = 1;
|
||||
eng1FireGnparkbrk.active = 1;
|
||||
} else {
|
||||
|
@ -458,7 +458,7 @@ var messages_priority_3 = func {
|
|||
ECAM_controller.warningReset(eng2FireGnlever);
|
||||
}
|
||||
|
||||
if (eng2FireGnparkbrk.clearFlag == 0 and pts.Controls.Gear.parkingBrake.getValue() == 0) {
|
||||
if (eng2FireGnparkbrk.clearFlag == 0 and pts.Controls.Gear.brakeParking.getValue() == 0) {
|
||||
eng2FireGnstopped.active = 1;
|
||||
eng2FireGnparkbrk.active = 1;
|
||||
} else {
|
||||
|
@ -3465,7 +3465,7 @@ var messages_right_memo = func {
|
|||
spd_brk.colour = "a";
|
||||
}
|
||||
|
||||
if (pts.Controls.Gear.parkingBrake.getValue() == 1 and phaseVarMemo3 != 3) {
|
||||
if (pts.Controls.Gear.brakeParking.getValue() == 1 and phaseVarMemo3 != 3) {
|
||||
park_brk.active = 1;
|
||||
} else {
|
||||
park_brk.active = 0;
|
||||
|
|
|
@ -78,7 +78,7 @@ var FCUController = {
|
|||
}
|
||||
),
|
||||
],
|
||||
resetFail: func() {
|
||||
resetFailures: func() {
|
||||
if (me._init == 0) { return; }
|
||||
me.FCU1.restore();
|
||||
me.FCU2.restore();
|
||||
|
|
|
@ -23,6 +23,7 @@ var variousReset = func() {
|
|||
setprop("/controls/switches/cabinCall", 0);
|
||||
setprop("/controls/switches/mechCall", 0);
|
||||
libraries.emerLtsSwitch.setValue(0.5);
|
||||
pts.Controls.Gear.brakeParking.setBoolValue(0);
|
||||
# cockpit voice recorder stuff
|
||||
setprop("/controls/CVR/power", 0);
|
||||
setprop("/controls/CVR/test", 0);
|
||||
|
@ -134,7 +135,7 @@ var MechCallFunc = func() {
|
|||
|
||||
var _CVRtestRunning = 0;
|
||||
var CVR_test = func() {
|
||||
if (pts.Controls.Gear.parkingBrake.getValue()) {
|
||||
if (pts.Controls.Gear.brakeParking.getValue()) {
|
||||
if (!_CVRtestRunning) {
|
||||
_CVRtestRunning = 1;
|
||||
cvr_tone.setValue(1);
|
||||
|
|
|
@ -22,17 +22,11 @@ var qty2 = math.round((rand() * 5 ) + 20, 0.1);
|
|||
setprop("/engines/engine[0]/oil-qt-actual", qty1);
|
||||
setprop("/engines/engine[1]/oil-qt-actual", qty2);
|
||||
|
||||
##########
|
||||
# Lights #
|
||||
##########
|
||||
# Aircraft Visual
|
||||
var beacon = aircraft.light.new("/sim/model/lights/beacon", [0.1, 1], "/controls/lighting/beacon");
|
||||
var strobe = aircraft.light.new("/sim/model/lights/strobe", [0.05, 0.06, 0.05, 1], "/controls/lighting/strobe");
|
||||
var tail_strobe = aircraft.light.new("/sim/model/lights/tailstrobe", [0.1, 1], "/controls/lighting/strobe");
|
||||
|
||||
###########
|
||||
# Effects #
|
||||
###########
|
||||
|
||||
var tiresmoke_system = aircraft.tyresmoke_system.new(0, 1, 2);
|
||||
aircraft.rain.init();
|
||||
|
||||
|
@ -68,10 +62,6 @@ var elements = ["AileronL","AileronR","Antenna1","Antenna2","ApuFlap","AvionicsV
|
|||
livery.createTarget("fuselage", elements, "sim/model/livery/texture-fuselage", defaultFuseLiv, resolution=16384);
|
||||
livery.addLayer("fuselage", "dirt", "Aircraft/A320-family/Models/Liveries/fuselage-dirt.png");
|
||||
|
||||
#########
|
||||
# Doors #
|
||||
#########
|
||||
|
||||
# Front doors
|
||||
var doorl1 = aircraft.door.new("/sim/model/door-positions/doorl1", 5);
|
||||
var doorr1 = aircraft.door.new("/sim/model/door-positions/doorr1", 5);
|
||||
|
@ -105,9 +95,7 @@ var triggerDoor = func(door, doorName, doorDesc) {
|
|||
}
|
||||
};
|
||||
|
||||
###########
|
||||
# Systems #
|
||||
###########
|
||||
# Systems
|
||||
var systemsInitialized = 0;
|
||||
var A320Libraries = nil;
|
||||
|
||||
|
@ -162,8 +150,8 @@ setlistener("/sim/signals/fdm-initialized", func() {
|
|||
|
||||
var collectorTankL = props.globals.getNode("/fdm/jsbsim/propulsion/tank[5]/contents-lbs");
|
||||
var collectorTankR = props.globals.getNode("/fdm/jsbsim/propulsion/tank[6]/contents-lbs");
|
||||
var groundAir = props.globals.getNode("/controls/pneumatics/switches/groundair");
|
||||
var groundCart = props.globals.getNode("/controls/electrical/ground-cart");
|
||||
var groundAir = props.globals.getNode("/controls/pneumatics/switches/ground-air");
|
||||
var groundCart = props.globals.getNode("/controls/electrical/switches/ground-cart");
|
||||
var chocks = props.globals.getNode("/services/chocks/enable");
|
||||
var groundspeed = 0;
|
||||
var stateL = 0;
|
||||
|
@ -217,6 +205,22 @@ var systemsLoop = func(notification) {
|
|||
atsu.ATSU.loop();
|
||||
libraries.BUTTONS.update();
|
||||
|
||||
pts.Services.Chocks.enableTemp = pts.Services.Chocks.enable.getBoolValue();
|
||||
pts.Velocities.groundspeedKtTemp = pts.Velocities.groundspeedKt.getValue();
|
||||
if ((pts.Velocities.groundspeedKtTemp >= 2 or !pts.Fdm.JSBsim.Position.wow.getBoolValue()) and pts.Services.Chocks.enableTemp) {
|
||||
pts.Services.Chocks.enable.setBoolValue(0);
|
||||
}
|
||||
|
||||
if ((pts.Velocities.groundspeedKtTemp >= 2 or (!pts.Controls.Gear.brakeParking.getBoolValue() and !pts.Services.Chocks.enableTemp)) and !acconfig.SYSTEM.autoConfigRunning.getBoolValue()) {
|
||||
if (systems.ELEC.Switch.groundCart.getBoolValue() or systems.ELEC.Switch.extPwr.getBoolValue()) {
|
||||
systems.ELEC.Switch.groundCart.setBoolValue(0);
|
||||
systems.ELEC.Switch.extPwr.setBoolValue(0);
|
||||
}
|
||||
if (systems.PNEU.Switch.groundAir.getBoolValue()) {
|
||||
systems.PNEU.Switch.groundAir.setBoolValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((notification.engine1State == 2 or notification.engine1State == 3) and collectorTankL.getValue() < 1) {
|
||||
systems.cutoff_one();
|
||||
}
|
||||
|
@ -321,9 +325,7 @@ canvas.Element.setVisible = func(vis) {
|
|||
me.setBool("visible", vis);
|
||||
};
|
||||
|
||||
##########
|
||||
# Misc #
|
||||
##########
|
||||
# Misc
|
||||
var pilotComfortTwoPos = func(prop) {
|
||||
var item = getprop(prop);
|
||||
if (item < 0.5) {
|
||||
|
@ -365,10 +367,6 @@ var r2Pedal = func() {
|
|||
pilotComfortOnePos("/controls/footrest-fo[1]");
|
||||
}
|
||||
|
||||
#####################
|
||||
# Auto-coordination #
|
||||
#####################
|
||||
|
||||
if (pts.Controls.Flight.autoCoordination.getBoolValue()) {
|
||||
pts.Controls.Flight.autoCoordination.setBoolValue(0);
|
||||
pts.Controls.Flight.aileronDrivesTiller.setBoolValue(1);
|
||||
|
@ -382,9 +380,7 @@ setlistener("/controls/flight/auto-coordination", func() {
|
|||
screen.log.write("Auto Coordination has been disabled as it is not compatible with the fly-by-wire of this aircraft", 1, 0, 0);
|
||||
}, 0, 0);
|
||||
|
||||
##############
|
||||
# Legacy FCU #
|
||||
##############
|
||||
# Legacy FCU
|
||||
var APPanel = {
|
||||
APDisc: func() {
|
||||
fcu.FCUController.APDisc();
|
||||
|
|
|
@ -60,9 +60,8 @@ var Controls = {
|
|||
},
|
||||
Gear: {
|
||||
brake: [props.globals.getNode("/controls/gear/brake-left"),props.globals.getNode("/controls/gear/brake-right")],
|
||||
brakeParking: props.globals.getNode("/controls/gear/brake-parking"),
|
||||
gearDown: props.globals.getNode("/controls/gear/gear-down"),
|
||||
parkingBrake: props.globals.getNode("/controls/gear/brake-parking"),
|
||||
chocks: props.globals.getNode("/services/chocks/enable"),
|
||||
},
|
||||
Lighting: {
|
||||
landingLights: [props.globals.getNode("/controls/lighting/landing-lights[0]"),props.globals.getNode("/controls/lighting/landing-lights[1]"),props.globals.getNode("/controls/lighting/landing-lights[2]")],
|
||||
|
@ -259,6 +258,13 @@ var Position = {
|
|||
longitude: props.globals.getNode("/position/longitude-deg"),
|
||||
};
|
||||
|
||||
var Services = {
|
||||
Chocks: {
|
||||
enable: props.globals.getNode("/services/chocks/enable"),
|
||||
enableTemp: 1,
|
||||
},
|
||||
};
|
||||
|
||||
var Sim = {
|
||||
aero: props.globals.getNode("/sim/aero"),
|
||||
aircraft: props.globals.getNode("/sim/aircraft"),
|
||||
|
@ -342,6 +348,7 @@ var Systems = {
|
|||
var Velocities = {
|
||||
airspeedKt: props.globals.getNode("/velocities/airspeed-kt"),
|
||||
groundspeedKt: props.globals.getNode("/velocities/groundspeed-kt"),
|
||||
groundspeedKtTemp: 0,
|
||||
mach: props.globals.getNode("/velocities/mach"),
|
||||
};
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ var BrakeSystem =
|
|||
var V2_R = V1 - me.BrakeDecel * dt * RBrakeLevel;
|
||||
|
||||
LThermalEnergy += (Mass * pts.Gear.compression[1].getValue() * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2);
|
||||
if (pts.Controls.Gear.chocks.getValue()) {
|
||||
if (pts.Services.Chocks.enable.getValue()) {
|
||||
if (!notification.parkingBrake) {
|
||||
# cooling effect: reduce thermal energy by (LnCoolFactor) * dt
|
||||
LThermalEnergy = LThermalEnergy * math.exp(LnCoolFactor * dt);
|
||||
|
@ -211,7 +211,7 @@ var BrakeSystem =
|
|||
};
|
||||
|
||||
RThermalEnergy += (Mass * pts.Gear.compression[2].getValue() * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2);
|
||||
if (pts.Controls.Gear.chocks.getValue()) {
|
||||
if (pts.Services.Chocks.enable.getValue()) {
|
||||
if (!notification.parkingBrake) {
|
||||
# cooling effect: reduce thermal energy by (RnCoolFactor) * dt
|
||||
RThermalEnergy = RThermalEnergy * math.exp(RnCoolFactor * dt);
|
||||
|
|
|
@ -84,17 +84,17 @@ var ELEC = {
|
|||
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"),
|
||||
glc2: props.globals.getNode("/systems/electrical/relay/gen-2-glc/contact-pos"),
|
||||
tr1Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/contact-pos"),
|
||||
tr2Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/contact-pos"),
|
||||
relay7XB: props.globals.getNode("/systems/electrical/sources/si-1/inverter-control/relay-7xb"),
|
||||
relay15XE2: props.globals.getNode("/systems/electrical/relay/relay-15XE2/contact-pos"),
|
||||
tr1Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/contact-pos"),
|
||||
tr2Contactor: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/contact-pos"),
|
||||
},
|
||||
SomeThing: {
|
||||
emerGenSignal: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-gen-operate"),
|
||||
galley: props.globals.getNode("/systems/electrical/some-electric-thingie/galley-shed"),
|
||||
},
|
||||
Source: {
|
||||
APU: {
|
||||
Apu: {
|
||||
volts: props.globals.getNode("/systems/electrical/sources/apu/output-volt"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/apu/output-hertz"),
|
||||
contact: props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos"),
|
||||
|
@ -125,6 +125,20 @@ var ELEC = {
|
|||
volts: props.globals.getNode("/systems/electrical/sources/ext/output-volt"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/ext/output-hertz"),
|
||||
},
|
||||
Idg1: {
|
||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/idg-1/output-hertz"),
|
||||
volts: props.globals.getNode("/systems/electrical/sources/idg-1/output-volt"),
|
||||
},
|
||||
Idg2: {
|
||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-2/gcr-relay"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/idg-2/output-hertz"),
|
||||
volts: props.globals.getNode("/systems/electrical/sources/idg-2/output-volt"),
|
||||
},
|
||||
Inverter: {
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/si-1/output-hertz"),
|
||||
volts: props.globals.getNode("/systems/electrical/sources/si-1/output-volt"),
|
||||
},
|
||||
tr1: {
|
||||
outputVolt: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output"),
|
||||
outputAmp: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output-amp"),
|
||||
|
@ -139,26 +153,13 @@ var ELEC = {
|
|||
outputVoltRelay: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/output"),
|
||||
outputAmpRelay: props.globals.getNode("/systems/electrical/relay/ess-tr-contactor/output-amp"),
|
||||
},
|
||||
IDG1: {
|
||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-1/gcr-relay"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/idg-1/output-hertz"),
|
||||
volts: props.globals.getNode("/systems/electrical/sources/idg-1/output-volt"),
|
||||
},
|
||||
IDG2: {
|
||||
gcrRelay: props.globals.getNode("/systems/electrical/sources/idg-2/gcr-relay"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/idg-2/output-hertz"),
|
||||
volts: props.globals.getNode("/systems/electrical/sources/idg-2/output-volt"),
|
||||
},
|
||||
Inverter: {
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/si-1/output-hertz"),
|
||||
volts: props.globals.getNode("/systems/electrical/sources/si-1/output-volt"),
|
||||
},
|
||||
},
|
||||
Switch: {
|
||||
acEssFeed: props.globals.getNode("/controls/electrical/switches/ac-ess-feed"),
|
||||
bat1: props.globals.getNode("/controls/electrical/switches/bat-1"),
|
||||
bat2: props.globals.getNode("/controls/electrical/switches/bat-2"),
|
||||
busTie: props.globals.getNode("/controls/electrical/switches/bus-tie"),
|
||||
emerElecManOn: props.globals.getNode("/controls/electrical/switches/emer-elec-man-on"), # non-reset
|
||||
emerGenTest: props.globals.getNode("/controls/electrical/switches/emer-gen-test"),
|
||||
extPwr: props.globals.getNode("/controls/electrical/switches/ext-pwr"),
|
||||
galley: props.globals.getNode("/controls/electrical/switches/galley"),
|
||||
|
@ -166,12 +167,12 @@ var ELEC = {
|
|||
gen2: props.globals.getNode("/controls/electrical/switches/gen-2"),
|
||||
genApu: props.globals.getNode("/controls/electrical/switches/apu"),
|
||||
gen1Line: props.globals.getNode("/controls/electrical/switches/gen-1-line-contactor"),
|
||||
groundCart: props.globals.getNode("/controls/electrical/switches/ground-cart"),
|
||||
idg1Disc: props.globals.getNode("/controls/electrical/switches/idg-1-disc"),
|
||||
idg2Disc: props.globals.getNode("/controls/electrical/switches/idg-2-disc"),
|
||||
emerElecManOn: props.globals.getNode("/controls/electrical/switches/emer-elec-man-on"), # non-reset
|
||||
},
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
me.resetFailures();
|
||||
me.SomeThing.emerGenSignal.setBoolValue(0);
|
||||
me.Switch.acEssFeed.setBoolValue(0);
|
||||
me.Switch.bat1.setBoolValue(0);
|
||||
|
@ -184,11 +185,12 @@ var ELEC = {
|
|||
me.Switch.gen2.setBoolValue(1);
|
||||
me.Switch.genApu.setBoolValue(1);
|
||||
me.Switch.gen1Line.setBoolValue(0);
|
||||
me.Switch.groundCart.setBoolValue(0);
|
||||
me.Switch.idg1Disc.setBoolValue(1);
|
||||
me.Switch.idg2Disc.setBoolValue(1);
|
||||
me.Switch.emerElecManOn.setBoolValue(0);
|
||||
},
|
||||
resetFail: func() {
|
||||
resetFailures: func() {
|
||||
me.Fail.acEssBusFault.setBoolValue(0);
|
||||
me.Fail.ac1BusFault.setBoolValue(0);
|
||||
me.Fail.ac2BusFault.setBoolValue(0);
|
||||
|
|
|
@ -43,7 +43,7 @@ var FADEC = {
|
|||
togaLk: props.globals.getNode("/fdm/jsbsim/fadec/toga-lk"),
|
||||
init: func() {
|
||||
me.engOut.setBoolValue(0);
|
||||
me.Limit.activeMode.setBoolValue("TOGA");
|
||||
me.Limit.activeMode.setValue("TOGA");
|
||||
me.Limit.activeModeInt.setValue(0);
|
||||
me.Limit.flexActive.setBoolValue(0);
|
||||
me.Limit.flexActiveCmd.setBoolValue(0);
|
||||
|
|
|
@ -109,7 +109,7 @@ var FBW = {
|
|||
fbwt.stop();
|
||||
}
|
||||
|
||||
me.resetFail();
|
||||
me.resetFailures();
|
||||
|
||||
me.Switches.elac1Sw.setBoolValue(1);
|
||||
me.Switches.elac2Sw.setBoolValue(1);
|
||||
|
@ -139,7 +139,7 @@ var FBW = {
|
|||
fbwt.start();
|
||||
}
|
||||
},
|
||||
resetFail: func() {
|
||||
resetFailures: func() {
|
||||
me.Failures.elac1.setBoolValue(0);
|
||||
me.Failures.elac2.setBoolValue(0);
|
||||
me.Failures.sec1.setBoolValue(0);
|
||||
|
|
|
@ -57,7 +57,7 @@ var FUEL = {
|
|||
offsetLeft: props.globals.getNode("/systems/fuel/offset-left"),
|
||||
offsetRight: props.globals.getNode("/systems/fuel/offset-right"),
|
||||
},
|
||||
resetFail: func() {
|
||||
resetFailures: func() {
|
||||
me.Fail.pumpLeft1.setValue(0);
|
||||
me.Fail.pumpLeft2.setValue(0);
|
||||
me.Fail.pumpCenter1.setValue(0);
|
||||
|
@ -66,7 +66,7 @@ var FUEL = {
|
|||
me.Fail.pumpRight2.setValue(0);
|
||||
},
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
me.resetFailures();
|
||||
},
|
||||
setOffsetLeft: func() {
|
||||
me.Quantity.offsetLeft.setValue(me.Quantity.offsetLeft.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
|
||||
|
|
|
@ -20,7 +20,6 @@ var ground_services = {
|
|||
|
||||
# Set them all to 0 if the aircraft is not stationary
|
||||
if (getprop("velocities/groundspeed-kt") >= 2) {
|
||||
setprop("/services/chocks/enable", 0);
|
||||
setprop("/services/fuel-truck/enable", 0);
|
||||
setprop("/services/deicing_truck/enable", 0);
|
||||
setprop("/services/catering/enable", 0);
|
||||
|
|
|
@ -68,7 +68,7 @@ var HYD = {
|
|||
yellowAbnormLoPr: props.globals.getNode("/ECAM/warnings/hyd/yellow-abnorm-lo-pr"),
|
||||
},
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
me.resetFailures();
|
||||
me.Qty.blueInput.setValue(8);
|
||||
me.Qty.greenInput.setValue(16);
|
||||
me.Qty.yellowInput.setValue(15);
|
||||
|
@ -81,7 +81,7 @@ var HYD = {
|
|||
me.Switch.yellowElec.setValue(0);
|
||||
me.Brakes.accumPressPsi.setValue(3000);
|
||||
},
|
||||
resetFail: func() {
|
||||
resetFailures: func() {
|
||||
me.Fail.blueElec.setBoolValue(0);
|
||||
me.Fail.blueLeak.setBoolValue(0);
|
||||
me.Fail.greenEng.setBoolValue(0);
|
||||
|
|
|
@ -21,7 +21,7 @@ var outflowpos = nil;
|
|||
var targetvs = nil;
|
||||
var eng1_starter = nil;
|
||||
var eng2_starter = nil;
|
||||
|
||||
|
||||
# Main class
|
||||
var PNEU = {
|
||||
Fail: {
|
||||
|
@ -70,14 +70,15 @@ var PNEU = {
|
|||
blower: props.globals.getNode("/controls/pneumatics/switches/blower"),
|
||||
cabinFans: props.globals.getNode("/controls/pneumatics/switches/cabin-fans"),
|
||||
extract: props.globals.getNode("/controls/pneumatics/switches/extract"),
|
||||
groundAir: props.globals.getNode("/controls/pneumatics/switches/ground-air"),
|
||||
hotAir: props.globals.getNode("/controls/pneumatics/switches/hot-air"),
|
||||
pack1: props.globals.getNode("/controls/pneumatics/switches/pack-1"),
|
||||
pack2: props.globals.getNode("/controls/pneumatics/switches/pack-2"),
|
||||
packFlow: props.globals.getNode("/controls/pneumatics/switches/pack-flow"),
|
||||
ramAir: props.globals.getNode("/controls/pneumatics/switches/ram-air"),
|
||||
tempAft: props.globals.getNode("/controls/pneumatics/switches/temp-cabin-aft"),
|
||||
tempFwd: props.globals.getNode("/controls/pneumatics/switches/temp-cabin-fwd"),
|
||||
tempCockpit: props.globals.getNode("/controls/pneumatics/switches/temp-cockpit"),
|
||||
tempFwd: props.globals.getNode("/controls/pneumatics/switches/temp-cabin-fwd"),
|
||||
xbleed: props.globals.getNode("/controls/pneumatics/switches/x-bleed"),
|
||||
},
|
||||
Warnings: {
|
||||
|
@ -104,7 +105,23 @@ var PNEU = {
|
|||
},
|
||||
pressMode: props.globals.getNode("/systems/pressurization/mode", 1),
|
||||
init: func() {
|
||||
me.resetFail();
|
||||
me.resetFailures();
|
||||
me.Switch.apu.setBoolValue(0);
|
||||
me.Switch.bleed1.setBoolValue(1);
|
||||
me.Switch.bleed2.setBoolValue(1);
|
||||
me.Switch.blower.setBoolValue(0);
|
||||
me.Switch.cabinFans.setBoolValue(0);
|
||||
me.Switch.extract.setBoolValue(0);
|
||||
me.Switch.groundAir.setBoolValue(0);
|
||||
me.Switch.hotAir.setBoolValue(1);
|
||||
me.Switch.pack1.setBoolValue(0);
|
||||
me.Switch.pack2.setBoolValue(0);
|
||||
me.Switch.packFlow.setValue(1);
|
||||
me.Switch.ramAir.setBoolValue(0);
|
||||
me.Switch.tempAft.setValue(0.5);
|
||||
me.Switch.tempCockpit.setValue(0.5);
|
||||
me.Switch.tempFwd.setValue(0.5);
|
||||
me.Switch.xbleed.setValue(1);
|
||||
|
||||
# Legacy pressurization system
|
||||
setprop("/systems/pressurization/mode", "GN");
|
||||
|
@ -143,7 +160,7 @@ var PNEU = {
|
|||
setprop("/controls/oxygen/passenger-mask-deploy-man", 0);
|
||||
setprop("/controls/oxygen/passenger-mask-reset", 0); # this is the TMR RESET pb on the maintenance panel, needs 3D model
|
||||
},
|
||||
resetFail: func() {
|
||||
resetFailures: func() {
|
||||
me.Fail.apu.setBoolValue(0);
|
||||
me.Fail.bleed1.setBoolValue(0);
|
||||
me.Fail.bleed2.setBoolValue(0);
|
||||
|
|
|
@ -717,7 +717,7 @@
|
|||
<function>
|
||||
<ifthen>
|
||||
<eq>
|
||||
<property>/controls/electrical/ground-cart</property>
|
||||
<property>/controls/electrical/switches/ground-cart</property>
|
||||
<value>1</value>
|
||||
</eq>
|
||||
<value>115</value>
|
||||
|
@ -1177,7 +1177,7 @@
|
|||
<test logic="AND" value="1">
|
||||
/systems/electrical/sources/ext/output-volt ge 110
|
||||
/controls/electrical/switches/ext-pwr eq 1
|
||||
/controls/electrical/ground-cart eq 1
|
||||
/controls/electrical/switches/ground-cart eq 1
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
|
|
|
@ -82,20 +82,6 @@
|
|||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/controls/pneumatics/switches/groundair">
|
||||
<default value="/controls/pneumatics/switches/groundair"/>
|
||||
<test logic="AND" value="0">
|
||||
/velocities/groundspeed-kt ge 2
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
<switch name="/controls/electrical/ground-cart">
|
||||
<default value="/controls/electrical/ground-cart"/>
|
||||
<test logic="AND" value="0">
|
||||
/velocities/groundspeed-kt ge 2
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
</channel>
|
||||
|
||||
</system>
|
||||
|
|
|
@ -674,7 +674,7 @@
|
|||
<fcs_function name="/systems/pneumatics/source/gnd-psi">
|
||||
<function>
|
||||
<product>
|
||||
<property>/controls/pneumatics/switches/groundair</property>
|
||||
<property>/controls/pneumatics/switches/ground-air</property>
|
||||
<value>34</value>
|
||||
</product>
|
||||
</function>
|
||||
|
|
Loading…
Add table
Reference in a new issue