Merge branch 'dev' into mcdukgs
This commit is contained in:
commit
1240862693
37 changed files with 917 additions and 903 deletions
|
@ -213,6 +213,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
|
|||
<system file="a320-adr"/>
|
||||
<system file="a320-apu"/>
|
||||
<system file="a320-fmgc"/>
|
||||
<system file="a320-misc"/>
|
||||
|
||||
<flight_control name="none"/>
|
||||
<aerodynamics file="Systems/a320-aerodynamics.xml"/>
|
||||
|
|
|
@ -212,6 +212,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
|
|||
<system file="a320-adr"/>
|
||||
<system file="a320-apu"/>
|
||||
<system file="a320-fmgc"/>
|
||||
<system file="a320-misc"/>
|
||||
|
||||
<flight_control name="none"/>
|
||||
<aerodynamics file="Systems/a320-aerodynamics.xml"/>
|
||||
|
|
|
@ -212,6 +212,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
|
|||
<system file="a320-adr"/>
|
||||
<system file="a320-apu"/>
|
||||
<system file="a320-fmgc"/>
|
||||
<system file="a320-misc"/>
|
||||
|
||||
<flight_control name="none"/>
|
||||
<aerodynamics file="Systems/a320-aerodynamics.xml"/>
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
|
||||
<PropertyList include="Aircraft/Generic/Human/Include/walker-include.xml">
|
||||
<sim>
|
||||
|
||||
|
||||
<animation>
|
||||
<fire-services type="bool">0</fire-services>
|
||||
</animation>
|
||||
|
||||
<author>Josh Davidson/Octal450 (Flight Dynamics, Systems, Displays), Jonathan Redpath/legoboyvdlp, merspieler, Matthew Maring/mattmaring (Systems, Displays), Thorsten Herrmann/TH-555, Semir Gebran/CaptB (3D, Textures)</author>
|
||||
|
||||
<checklists include="A32X-Checklists.xml"/>
|
||||
|
@ -719,6 +723,11 @@
|
|||
<max-athr-thrust type="double">0.94</max-athr-thrust>
|
||||
<throttle-output type="double">0</throttle-output>
|
||||
<throttle-fdm type="double">0</throttle-fdm>
|
||||
<throttle-rev type="double">0</throttle-rev>
|
||||
<reverser type="double">0</reverser>
|
||||
<igniter-a type="bool">0</igniter-a>
|
||||
<igniter-b type="bool">0</igniter-b>
|
||||
<last-igniter type="string">B</last-igniter>
|
||||
</engine>
|
||||
<engine n="1">
|
||||
<cutoff type="bool">true</cutoff>
|
||||
|
@ -732,6 +741,11 @@
|
|||
<max-athr-thrust type="double">0.94</max-athr-thrust>
|
||||
<throttle-output type="double">0</throttle-output>
|
||||
<throttle-fdm type="double">0</throttle-fdm>
|
||||
<throttle-rev type="double">0</throttle-rev>
|
||||
<reverser type="double">0</reverser>
|
||||
<igniter-a type="bool">0</igniter-a>
|
||||
<igniter-b type="bool">0</igniter-b>
|
||||
<last-igniter type="string">B</last-igniter>
|
||||
</engine>
|
||||
<engine n="2">
|
||||
<cutoff type="bool">true</cutoff>
|
||||
|
@ -789,6 +803,7 @@
|
|||
</refuel>
|
||||
</fuel>
|
||||
<gear>
|
||||
<brake-fans type="bool">0</brake-fans>
|
||||
<brake-parking type="bool">0</brake-parking>
|
||||
<tiller-cmd-norm type="double">0</tiller-cmd-norm>
|
||||
<tiller-enabled type="bool">0</tiller-enabled>
|
||||
|
@ -987,12 +1002,18 @@
|
|||
<caster-angle-deg-damped type="double">0</caster-angle-deg-damped>
|
||||
</gear>
|
||||
<gear n="1">
|
||||
<Lbrake-smoke type="double">0</Lbrake-smoke>
|
||||
<L1brake-temp-degc type="double">15</L1brake-temp-degc>
|
||||
<L2brake-temp-degc type="double">15</L2brake-temp-degc>
|
||||
<tyre-smoke type="int">0</tyre-smoke>
|
||||
<sprayspeed-ms type="double">0</sprayspeed-ms>
|
||||
<spray-density type="double">0</spray-density>
|
||||
<caster-angle-deg-damped type="double">0</caster-angle-deg-damped>
|
||||
</gear>
|
||||
<gear n="2">
|
||||
<Rbrake-smoke type="double">0</Rbrake-smoke>
|
||||
<R3brake-temp-degc type="double">15</R3brake-temp-degc>
|
||||
<R4brake-temp-degc type="double">15</R4brake-temp-degc>
|
||||
<tyre-smoke type="int">0</tyre-smoke>
|
||||
<sprayspeed-ms type="double">0</sprayspeed-ms>
|
||||
<spray-density type="double">0</spray-density>
|
||||
|
@ -1254,6 +1275,8 @@
|
|||
<valves>
|
||||
<apu-lp-valve-cmd type="bool">0</apu-lp-valve-cmd>
|
||||
</valves>
|
||||
<offset-left type="double">0</offset-left>
|
||||
<offset-right type="double">0</offset-right>
|
||||
<fuel-used-1 type="double">0</fuel-used-1>
|
||||
<fuel-used-2 type="double">0</fuel-used-2>
|
||||
<mode-fault type="bool">0</mode-fault>
|
||||
|
|
|
@ -212,6 +212,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
|
|||
<system file="a320-adr"/>
|
||||
<system file="a320-apu"/>
|
||||
<system file="a320-fmgc"/>
|
||||
<system file="a320-misc"/>
|
||||
|
||||
<flight_control name="none"/>
|
||||
<aerodynamics file="Systems/a320-aerodynamics.xml"/>
|
||||
|
|
|
@ -212,6 +212,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
|
|||
<system file="a320-adr"/>
|
||||
<system file="a320-apu"/>
|
||||
<system file="a320-fmgc"/>
|
||||
<system file="a320-misc"/>
|
||||
|
||||
<flight_control name="none"/>
|
||||
<aerodynamics file="Systems/a320-aerodynamics.xml"/>
|
||||
|
|
|
@ -43,6 +43,7 @@ LBS2KGS = 0.4535924;
|
|||
# Fetch Nodes
|
||||
var acconfig_weight_kgs = props.globals.getNode("/systems/acconfig/options/weight-kgs", 1);
|
||||
var elapsed_sec = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
||||
var rate = props.globals.getNode("/systems/acconfig/options/lecam-rate", 1);
|
||||
var autoconfig_running = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
|
||||
var lighting_du4 = props.globals.getNode("/controls/lighting/DU/du4", 1);
|
||||
var ecam_page = props.globals.getNode("/ECAM/Lower/page", 1);
|
||||
|
@ -115,43 +116,6 @@ var cargobulk_pos = props.globals.getNode("/sim/model/door-positions/cargobulk/p
|
|||
var cargofwd_pos = props.globals.getNode("/sim/model/door-positions/cargofwd/position-norm", 1);
|
||||
var cargoaft_pos = props.globals.getNode("/sim/model/door-positions/cargoaft/position-norm", 1);
|
||||
|
||||
# Electrical nodes
|
||||
var apu_volts = props.globals.getNode("/systems/electrical/sources/apu/output-volt", 1);
|
||||
var apu_hz = props.globals.getNode("/systems/electrical/sources/apu/output-hertz", 1);
|
||||
var gen_apu = props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos", 1);
|
||||
var switch_bat1 = props.globals.getNode("/controls/electrical/switches/bat-1", 1);
|
||||
var switch_bat2 = props.globals.getNode("/controls/electrical/switches/bat-2", 1);
|
||||
var bat1_amps = props.globals.getNode("/systems/electrical/sources/bat-1/amps", 1);
|
||||
var bat2_amps = props.globals.getNode("/systems/electrical/sources/bat-2/amps", 1);
|
||||
var bat1_volts = props.globals.getNode("/systems/electrical/sources/bat-1/volt", 1);
|
||||
var bat2_volts = props.globals.getNode("/systems/electrical/sources/bat-2/volt", 1);
|
||||
var bat1_fault = props.globals.getNode("/systems/electrical/light/bat-1-fault", 1);
|
||||
var bat2_fault = props.globals.getNode("/systems/electrical/light/bat-2-fault", 1);
|
||||
var bat1_direction = props.globals.getNode("/systems/electrical/sources/bat-1/direction", 1);
|
||||
var bat2_direction = props.globals.getNode("/systems/electrical/sources/bat-2/direction", 1);
|
||||
var emerGenVolts = props.globals.getNode("/systems/electrical/relay/emer-glc/output", 1);
|
||||
var emerGenHz = props.globals.getNode("/systems/electrical/sources/emer-gen/output-hertz", 1);
|
||||
var tr1_volts = props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output", 1);
|
||||
var tr2_volts = props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output", 1);
|
||||
var tr1_amps = props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output-amp", 1);
|
||||
var tr2_amps = props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output-amp", 1);
|
||||
var switch_emer_gen = props.globals.getNode("/systems/electrical/sources/emer-gen/output-volt", 1);
|
||||
var switch_gen1 = props.globals.getNode("/controls/electrical/switches/gen-1", 1);
|
||||
var switch_gen2 = props.globals.getNode("/controls/electrical/switches/gen-2", 1);
|
||||
var gen1_volts = props.globals.getNode("/systems/electrical/sources/idg-1/output-volt", 1);
|
||||
var gen2_volts = props.globals.getNode("/systems/electrical/sources/idg-2/output-volt", 1);
|
||||
var gen1_hz = props.globals.getNode("/systems/electrical/sources/idg-1/output-hertz", 1);
|
||||
var gen2_hz = props.globals.getNode("/systems/electrical/sources/idg-2/output-hertz", 1);
|
||||
var ext_volts = props.globals.getNode("/systems/electrical/sources/ext/output-volt", 1);
|
||||
var ext_hz = props.globals.getNode("/systems/electrical/sources/ext/output-hertz", 1);
|
||||
var galleyshed = props.globals.getNode("/systems/electrical/some-electric-thingie/galley-shed", 1);
|
||||
var switch_galley = props.globals.getNode("/controls/electrical/switches/galley", 1);
|
||||
var switch_ac_ess_feed = props.globals.getNode("/controls/electrical/switches/ac-ess-feed", 1);
|
||||
var tr1_fault = props.globals.getNode("/systems/failures/electrical/tr-1", 1);
|
||||
var tr2_fault = props.globals.getNode("/systems/failures/electrical/tr-2", 1);
|
||||
var essTrVolt = props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output", 1);
|
||||
var essTrAmp = props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output-amp", 1);
|
||||
|
||||
# Hydraulic
|
||||
var blue_psi = 0;
|
||||
var green_psi = 0;
|
||||
|
@ -211,6 +175,7 @@ var eng2_n1 = props.globals.getNode("/engines/engine[1]/n1-actual", 1);
|
|||
var total_fuel_lbs = props.globals.getNode("/consumables/fuel/total-fuel-lbs", 1);
|
||||
var fadec1 = props.globals.getNode("/systems/fadec/powered1", 1);
|
||||
var fadec2 = props.globals.getNode("/systems/fadec/powered2", 1);
|
||||
var fadecPowerUp = props.globals.getNode("/systems/fadec/powerup", 1);
|
||||
var fuel_flow1 = props.globals.getNode("/engines/engine[0]/fuel-flow_actual", 1);
|
||||
var fuel_flow2 = props.globals.getNode("/engines/engine[1]/fuel-flow_actual", 1);
|
||||
var fuel_left_outer_temp = props.globals.getNode("/consumables/fuel/tank[0]/temperature_degC", 1);
|
||||
|
@ -265,12 +230,12 @@ var canvas_lowerECAM_base = {
|
|||
|
||||
if (systems.ELEC.Bus.ac2.getValue() >= 110) {
|
||||
if (du4_offtime.getValue() + 3 < elapsedtime) {
|
||||
if (gear0_wow.getValue() == 1) {
|
||||
if (gear0_wow.getValue()) {
|
||||
if (autoconfig_running.getValue() != 1 and du4_test.getValue() != 1) {
|
||||
du4_test.setValue(1);
|
||||
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
|
||||
du4_test_time.setValue(elapsedtime);
|
||||
} else if (autoconfig_running.getValue() == 1 and du4_test.getValue() != 1) {
|
||||
} else if (autoconfig_running.getValue() and du4_test.getValue() != 1) {
|
||||
du4_test.setValue(1);
|
||||
du4_test_amount.setValue(math.round((rand() * 5 ) + 35, 0.1));
|
||||
du4_test_time.setValue(elapsedtime - 30);
|
||||
|
@ -555,7 +520,7 @@ var canvas_lowerECAM_base = {
|
|||
|
||||
me["UTCh"].setText(sprintf("%02d", hour.getValue()));
|
||||
me["UTCm"].setText(sprintf("%02d", minute.getValue()));
|
||||
if (acconfig_weight_kgs.getValue() == 1) {
|
||||
if (acconfig_weight_kgs.getValue()) {
|
||||
me["GW"].setText(sprintf("%s", math.round(math.round(gw.getValue() * LBS2KGS, 100))));
|
||||
me["GW-weight-unit"].setText("KG");
|
||||
} else {
|
||||
|
@ -578,7 +543,7 @@ var canvas_lowerECAM_apu = {
|
|||
},
|
||||
update: func() {
|
||||
# Avail and Flap Open
|
||||
if (apu_flap.getValue() == 1) {
|
||||
if (apu_flap.getValue()) {
|
||||
me["APUFlapOpen"].show();
|
||||
} else {
|
||||
me["APUFlapOpen"].hide();
|
||||
|
@ -597,19 +562,19 @@ var canvas_lowerECAM_apu = {
|
|||
}
|
||||
|
||||
# APU Gen
|
||||
if (apu_volts.getValue() >= 110) {
|
||||
if (systems.ELEC.Source.APU.volts.getValue() >= 110) {
|
||||
me["APUGenVolt"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["APUGenVolt"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
||||
if (apu_hz.getValue() > 380) {
|
||||
if (systems.ELEC.Source.APU.hertz.getValue() > 380) {
|
||||
me["APUGenHz"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["APUGenHz"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
||||
if (systems.APUNodes.Controls.master.getValue() == 1 or apu_rpm.getValue() >= 94.9) {
|
||||
if (systems.APUNodes.Controls.master.getValue() or apu_rpm.getValue() >= 94.9) {
|
||||
me["APUGenbox"].show();
|
||||
me["APUGenHz"].show();
|
||||
me["APUGenVolt"].show();
|
||||
|
@ -627,24 +592,24 @@ var canvas_lowerECAM_apu = {
|
|||
me["text3732"].hide();
|
||||
}
|
||||
|
||||
if ((apu_rpm.getValue() > 94.9) and (gen_apu.getValue() == 1)) {
|
||||
if ((apu_rpm.getValue() > 94.9) and (systems.ELEC.Source.APU.contact.getValue())) {
|
||||
me["APUGenOnline"].show();
|
||||
} else {
|
||||
me["APUGenOnline"].hide();
|
||||
}
|
||||
|
||||
if ((systems.APUNodes.Controls.master.getValue() == 0) or ((systems.APUNodes.Controls.master.getValue() == 1) and (gen_apu.getValue() == 1) and (apu_rpm.getValue() > 94.9))) {
|
||||
if ((systems.APUNodes.Controls.master.getValue() == 0) or ((systems.APUNodes.Controls.master.getValue()) and (systems.ELEC.Source.APU.contact.getValue()) and (apu_rpm.getValue() > 94.9))) {
|
||||
me["APUGentext"].setColor(0.8078,0.8039,0.8078);
|
||||
} else if ((systems.APUNodes.Controls.master.getValue() == 1) and (gen_apu.getValue() == 0) and (apu_rpm.getValue() < 94.9)) {
|
||||
} else if ((systems.APUNodes.Controls.master.getValue()) and (systems.ELEC.Source.APU.contact.getValue() == 0) and (apu_rpm.getValue() < 94.9)) {
|
||||
me["APUGentext"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
||||
me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue())));
|
||||
me["APUGenVolt"].setText(sprintf("%s", math.round(apu_volts.getValue())));
|
||||
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
|
||||
me["APUGenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.volts.getValue())));
|
||||
me["APUGenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.hertz.getValue())));
|
||||
|
||||
# APU Bleed
|
||||
if (systems.ADIRS.Operating.adr[0].getValue() and (systems.APUNodes.Controls.bleed.getValue() == 1 or bleedapu.getValue() > 0)) {
|
||||
if (systems.ADIRS.Operating.adr[0].getValue() and (systems.APUNodes.Controls.bleed.getValue() or bleedapu.getValue() > 0)) {
|
||||
me["APUBleedPSI"].setColor(0.0509,0.7529,0.2941);
|
||||
me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue())));
|
||||
} else {
|
||||
|
@ -669,7 +634,7 @@ var canvas_lowerECAM_apu = {
|
|||
|
||||
|
||||
# APU N and EGT
|
||||
if (systems.APUNodes.Controls.master.getValue() == 1) {
|
||||
if (systems.APUNodes.Controls.master.getValue()) {
|
||||
me["APUN"].setColor(0.0509,0.7529,0.2941);
|
||||
me["APUN"].setText(sprintf("%s", math.round(apu_rpm.getValue() or 0)));
|
||||
me["APUEGT"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -871,7 +836,7 @@ var canvas_lowerECAM_bleed = {
|
|||
if (bmc1working.getValue()) {
|
||||
var precooler_temp = precooler1_temp.getValue();
|
||||
me["BLEED-Precooler-1-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5)));
|
||||
if (eng_valve1_cmd.getValue() == 1 and (precooler_temp < 150 or precooler1_ovht.getValue())) {
|
||||
if (eng_valve1_cmd.getValue() and (precooler_temp < 150 or precooler1_ovht.getValue())) {
|
||||
me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["BLEED-Precooler-1-Outlet-Temp"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -885,7 +850,7 @@ var canvas_lowerECAM_bleed = {
|
|||
if (bmc2working.getValue()) {
|
||||
var precooler_temp = precooler2_temp.getValue();
|
||||
me["BLEED-Precooler-2-Outlet-Temp"].setText(sprintf("%s", math.round(precooler_temp, 5)));
|
||||
if (eng_valve2_cmd.getValue() == 1 and (precooler_temp < 150 or precooler2_ovht.getValue())) {
|
||||
if (eng_valve2_cmd.getValue() and (precooler_temp < 150 or precooler2_ovht.getValue())) {
|
||||
me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["BLEED-Precooler-2-Outlet-Temp"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -903,7 +868,7 @@ var canvas_lowerECAM_bleed = {
|
|||
}
|
||||
|
||||
# WING ANTI ICE
|
||||
if (switch_wing_aice.getValue() == 1) {
|
||||
if (switch_wing_aice.getValue()) {
|
||||
me["BLEED-Anti-Ice-Left"].show();
|
||||
me["BLEED-Anti-Ice-Right"].show();
|
||||
} else {
|
||||
|
@ -1015,7 +980,7 @@ var canvas_lowerECAM_bleed = {
|
|||
me["BLEED-Ram-Air"].setColor(0.0509,0.7529,0.2941);
|
||||
me["BLEED-Ram-Air"].setColorFill(0.0509,0.7529,0.2941);
|
||||
me["BLEED-Ram-Air-connection"].hide();
|
||||
} elsif (systems.PNEU.Valves.ramAir.getValue() == 1) {
|
||||
} elsif (systems.PNEU.Valves.ramAir.getValue()) {
|
||||
me["BLEED-Ram-Air"].setRotation(0);
|
||||
if (pts.Gear.wow[1].getValue()) {
|
||||
me["BLEED-Ram-Air"].setColor(0.7333,0.3803,0);
|
||||
|
@ -1117,7 +1082,7 @@ var canvas_lowerECAM_crz = {
|
|||
me["Oil1"].setText(sprintf("%2.1f", oil_qt1_actual.getValue()));
|
||||
me["Oil2"].setText(sprintf("%2.1f", oil_qt2_actual.getValue()));
|
||||
|
||||
if (acconfig_weight_kgs.getValue() == 1) {
|
||||
if (acconfig_weight_kgs.getValue()) {
|
||||
me["Fused-weight-unit"].setText("KG");
|
||||
me["FUsed1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10)));
|
||||
me["FUsed2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)));
|
||||
|
@ -1297,7 +1262,7 @@ var canvas_lowerECAM_elec = {
|
|||
update: func() {
|
||||
|
||||
# BAT1
|
||||
if (switch_bat1.getValue() == 0) {
|
||||
if (systems.ELEC.Switch.bat1.getValue() == 0) {
|
||||
me["BAT1-OFF"].show();
|
||||
me["BAT1-content"].hide();
|
||||
me["BAT1-discharge"].hide();
|
||||
|
@ -1305,26 +1270,26 @@ var canvas_lowerECAM_elec = {
|
|||
} else {
|
||||
me["BAT1-OFF"].hide();
|
||||
me["BAT1-content"].show();
|
||||
me["Bat1Ampere"].setText(sprintf("%s", math.round(bat1_amps.getValue())));
|
||||
me["Bat1Volt"].setText(sprintf("%s", math.round(bat1_volts.getValue())));
|
||||
me["Bat1Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.amps.getValue())));
|
||||
me["Bat1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat1.volt.getValue())));
|
||||
|
||||
if (bat1_volts.getValue() >= 24.95 and bat1_volts.getValue() <= 31.05) {
|
||||
if (systems.ELEC.Source.Bat1.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat1.volt.getValue() <= 31.05) {
|
||||
me["Bat1Volt"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Bat1Volt"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
||||
if (bat1_amps.getValue() > 5) {
|
||||
if (systems.ELEC.Source.Bat1.amps.getValue() > 5) {
|
||||
me["Bat1Ampere"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Bat1Ampere"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (bat1_direction.getValue() == 0) {
|
||||
if (systems.ELEC.Source.Bat1.direction.getValue() == 0) {
|
||||
me["BAT1-discharge"].hide();
|
||||
me["BAT1-charge"].hide();
|
||||
} else {
|
||||
if (bat1_direction.getValue() == -1) {
|
||||
if (systems.ELEC.Source.Bat1.direction.getValue() == -1) {
|
||||
me["BAT1-charge"].show();
|
||||
me["BAT1-discharge"].hide();
|
||||
} else {
|
||||
|
@ -1334,14 +1299,14 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
}
|
||||
|
||||
if (bat1_fault.getValue() == 1 or bat1_volts.getValue() < 25 or bat1_volts.getValue() > 31 or bat1_amps.getValue() > 5) {
|
||||
if (systems.ELEC.Light.bat1Fault.getValue() or systems.ELEC.Source.Bat1.volt.getValue() < 25 or systems.ELEC.Source.Bat1.volt.getValue() > 31 or systems.ELEC.Source.Bat1.amps.getValue() > 5) {
|
||||
me["BAT1-label"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["BAT1-label"].setColor(0.8078,0.8039,0.8078);
|
||||
}
|
||||
|
||||
# BAT2
|
||||
if (switch_bat2.getValue() == 0) {
|
||||
if (systems.ELEC.Switch.bat2.getValue() == 0) {
|
||||
me["BAT2-OFF"].show();
|
||||
me["BAT2-content"].hide();
|
||||
me["BAT2-discharge"].hide();
|
||||
|
@ -1349,26 +1314,26 @@ var canvas_lowerECAM_elec = {
|
|||
} else {
|
||||
me["BAT2-OFF"].hide();
|
||||
me["BAT2-content"].show();
|
||||
me["Bat2Ampere"].setText(sprintf("%s", math.round(bat2_amps.getValue())));
|
||||
me["Bat2Volt"].setText(sprintf("%s", math.round(bat2_volts.getValue())));
|
||||
me["Bat2Ampere"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.amps.getValue())));
|
||||
me["Bat2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Bat2.volt.getValue())));
|
||||
|
||||
if (bat2_volts.getValue() >= 24.95 and bat2_volts.getValue() <= 31.05) {
|
||||
if (systems.ELEC.Source.Bat2.volt.getValue() >= 24.95 and systems.ELEC.Source.Bat2.volt.getValue() <= 31.05) {
|
||||
me["Bat2Volt"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["Bat2Volt"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
||||
if (bat2_amps.getValue() > 5) {
|
||||
if (systems.ELEC.Source.Bat2.amps.getValue() > 5) {
|
||||
me["Bat2Ampere"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Bat2Ampere"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (bat2_direction.getValue() == 0) {
|
||||
if (systems.ELEC.Source.Bat2.direction.getValue() == 0) {
|
||||
me["BAT2-discharge"].hide();
|
||||
me["BAT2-charge"].hide();
|
||||
} else {
|
||||
if (bat2_direction.getValue() == -1) {
|
||||
if (systems.ELEC.Source.Bat2.direction.getValue() == -1) {
|
||||
me["BAT2-charge"].show();
|
||||
me["BAT2-discharge"].hide();
|
||||
} else {
|
||||
|
@ -1378,7 +1343,7 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
}
|
||||
|
||||
if (bat2_fault.getValue() == 1 or bat2_volts.getValue() < 25 or bat2_volts.getValue() > 31 or bat2_amps.getValue() > 5) {
|
||||
if (systems.ELEC.Light.bat2Fault.getValue() or systems.ELEC.Source.Bat2.volt.getValue() < 25 or systems.ELEC.Source.Bat2.volt.getValue() > 31 or systems.ELEC.Source.Bat2.amps.getValue() > 5) {
|
||||
me["BAT2-label"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["BAT2-label"].setColor(0.8078,0.8039,0.8078);
|
||||
|
@ -1386,8 +1351,8 @@ var canvas_lowerECAM_elec = {
|
|||
|
||||
# TR1
|
||||
# is only powered when ac1 has power
|
||||
tr1_v = tr1_volts.getValue();
|
||||
tr1_a = tr1_amps.getValue();
|
||||
tr1_v = systems.ELEC.Source.tr1.outputVolt.getValue();
|
||||
tr1_a = systems.ELEC.Source.tr1.outputAmp.getValue();
|
||||
|
||||
me["TR1Volt"].setText(sprintf("%s", math.round(tr1_v)));
|
||||
me["TR1Ampere"].setText(sprintf("%s", math.round(tr1_a)));
|
||||
|
@ -1412,8 +1377,8 @@ var canvas_lowerECAM_elec = {
|
|||
|
||||
# TR2
|
||||
# is only powered when ac2 has power
|
||||
tr2_v = tr2_volts.getValue();
|
||||
tr2_a = tr2_amps.getValue();
|
||||
tr2_v = systems.ELEC.Source.tr2.outputVolt.getValue();
|
||||
tr2_a = systems.ELEC.Source.tr2.outputAmp.getValue();
|
||||
|
||||
me["TR2Volt"].setText(sprintf("%s", math.round(tr2_v)));
|
||||
me["TR2Ampere"].setText(sprintf("%s", math.round(tr2_a)));
|
||||
|
@ -1437,8 +1402,8 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
|
||||
# ESS TR
|
||||
essTrvolts = essTrVolt.getValue();
|
||||
essTramps = essTrAmp.getValue();
|
||||
essTrvolts = systems.ELEC.Source.trEss.outputVoltRelay.getValue();
|
||||
essTramps = systems.ELEC.Source.trEss.outputAmpRelay.getValue();
|
||||
if (systems.ELEC.Relay.essTrContactor.getValue()) {
|
||||
me["ESSTR-group"].show();
|
||||
me["ESSTR-Volt"].setText(sprintf("%s", math.round(essTrvolts)));
|
||||
|
@ -1466,7 +1431,7 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
|
||||
# EMER GEN
|
||||
if (switch_emer_gen.getValue() == 0) {
|
||||
if (systems.ELEC.Source.EmerGen.volts.getValue() == 0) {
|
||||
me["EMERGEN-group"].hide();
|
||||
me["ELEC-Line-Emergen-ESSTR"].hide();
|
||||
me["ELEC-Line-Emergen-ESSTR-off"].show();
|
||||
|
@ -1477,22 +1442,22 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-Emergen-ESSTR-off"].hide();
|
||||
me["EMERGEN-Label-off"].hide();
|
||||
|
||||
me["EmergenVolt"].setText(sprintf("%s", math.round(emerGenVolts.getValue())));
|
||||
me["EmergenHz"].setText(sprintf("%s", math.round(emerGenHz.getValue())));
|
||||
me["EmergenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.voltsRelay.getValue())));
|
||||
me["EmergenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.EmerGen.hertz.getValue())));
|
||||
|
||||
if (emerGenVolts.getValue() > 120 or emerGenVolts.getValue() < 110 or emerGenHz.getValue() > 410 or emerGenHz.getValue() < 390) {
|
||||
if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110 or systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) {
|
||||
me["Emergen-Label"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Emergen-Label"].setColor(0.8078,0.8039,0.8078);
|
||||
}
|
||||
|
||||
if (emerGenVolts.getValue() > 120 or emerGenVolts.getValue() < 110) {
|
||||
if (systems.ELEC.Source.EmerGen.voltsRelay.getValue() > 120 or systems.ELEC.Source.EmerGen.voltsRelay.getValue() < 110) {
|
||||
me["EmergenVolt"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["EmergenVolt"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (emerGenHz.getValue() > 410 or emerGenHz.getValue() < 390) {
|
||||
if (systems.ELEC.Source.EmerGen.hertz.getValue() > 410 or systems.ELEC.Source.EmerGen.hertz.getValue() < 390) {
|
||||
me["EmergenHz"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["EmergenHz"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -1530,7 +1495,7 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
|
||||
# GEN1
|
||||
if (switch_gen1.getValue() == 0) {
|
||||
if (systems.ELEC.Switch.gen1.getValue() == 0) {
|
||||
me["GEN1-content"].hide();
|
||||
me["GEN1-off"].show();
|
||||
if (systems.ELEC.Source.IDG1.gcrRelay.getValue()) {
|
||||
|
@ -1548,12 +1513,12 @@ var canvas_lowerECAM_elec = {
|
|||
me["GEN1-content"].show();
|
||||
me["GEN1-off"].hide();
|
||||
# me["Gen1Load"].setText(sprintf("%s", math.round(gen1_load.getValue())));
|
||||
me["Gen1Volt"].setText(sprintf("%s", math.round(gen1_volts.getValue())));
|
||||
me["Gen1Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.volts.getValue())));
|
||||
|
||||
if (gen1_hz.getValue() == 0) {
|
||||
if (systems.ELEC.Source.IDG1.hertz.getValue() == 0) {
|
||||
me["Gen1Hz"].setText(sprintf("XX"));
|
||||
} else {
|
||||
me["Gen1Hz"].setText(sprintf("%s", math.round(gen1_hz.getValue())));
|
||||
me["Gen1Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG1.hertz.getValue())));
|
||||
}
|
||||
|
||||
if (eng1_running.getValue() == 0) {
|
||||
|
@ -1562,7 +1527,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["GEN1-num-label"].setColor(0.8078,0.8039,0.8078);
|
||||
}
|
||||
|
||||
if (gen1_volts.getValue() > 120 or gen1_volts.getValue() < 110 or gen1_hz.getValue() > 410 or gen1_hz.getValue() < 390 or gen1_load.getValue() >= 110) {
|
||||
if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110 or systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390 or gen1_load.getValue() >= 110) {
|
||||
me["GEN1-label"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["GEN1-label"].setColor(0.8078,0.8039,0.8078);
|
||||
|
@ -1574,13 +1539,13 @@ var canvas_lowerECAM_elec = {
|
|||
me["Gen1Load"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (gen1_volts.getValue() > 120 or gen1_volts.getValue() < 110) {
|
||||
if (systems.ELEC.Source.IDG1.volts.getValue() > 120 or systems.ELEC.Source.IDG1.volts.getValue() < 110) {
|
||||
me["Gen1Volt"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Gen1Volt"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (gen1_hz.getValue() > 410 or gen1_hz.getValue() < 390) {
|
||||
if (systems.ELEC.Source.IDG1.hertz.getValue() > 410 or systems.ELEC.Source.IDG1.hertz.getValue() < 390) {
|
||||
me["Gen1Hz"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Gen1Hz"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -1588,7 +1553,7 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
|
||||
# GEN2
|
||||
if (switch_gen2.getValue() == 0) {
|
||||
if (systems.ELEC.Switch.gen2.getValue() == 0) {
|
||||
me["GEN2-content"].hide();
|
||||
me["GEN2-off"].show();
|
||||
if (systems.ELEC.Source.IDG2.gcrRelay.getValue()) {
|
||||
|
@ -1606,11 +1571,11 @@ var canvas_lowerECAM_elec = {
|
|||
me["GEN2-content"].show();
|
||||
me["GEN2-off"].hide();
|
||||
# me["Gen2Load"].setText(sprintf("%s", math.round(gen2_load.getValue())));
|
||||
me["Gen2Volt"].setText(sprintf("%s", math.round(gen2_volts.getValue())));
|
||||
if (gen2_hz.getValue() == 0) {
|
||||
me["Gen2Volt"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.volts.getValue())));
|
||||
if (systems.ELEC.Source.IDG2.hertz.getValue() == 0) {
|
||||
me["Gen2Hz"].setText(sprintf("XX"));
|
||||
} else {
|
||||
me["Gen2Hz"].setText(sprintf("%s", math.round(gen2_hz.getValue())));
|
||||
me["Gen2Hz"].setText(sprintf("%s", math.round(systems.ELEC.Source.IDG2.hertz.getValue())));
|
||||
}
|
||||
|
||||
if (eng2_running.getValue() == 0) {
|
||||
|
@ -1619,7 +1584,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["GEN2-num-label"].setColor(0.8078,0.8039,0.8078);
|
||||
}
|
||||
|
||||
if (gen2_volts.getValue() > 120 or gen2_volts.getValue() < 110 or gen2_hz.getValue() > 410 or gen2_hz.getValue() < 390 or gen2_load.getValue() >= 110) {
|
||||
if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110 or systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390 or gen2_load.getValue() >= 110) {
|
||||
me["GEN2-label"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["GEN2-label"].setColor(0.8078,0.8039,0.8078);
|
||||
|
@ -1632,13 +1597,13 @@ var canvas_lowerECAM_elec = {
|
|||
}
|
||||
|
||||
|
||||
if (gen2_volts.getValue() > 120 or gen2_volts.getValue() < 110) {
|
||||
if (systems.ELEC.Source.IDG2.volts.getValue() > 120 or systems.ELEC.Source.IDG2.volts.getValue() < 110) {
|
||||
me["Gen2Volt"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Gen2Volt"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (gen2_hz.getValue() > 410 or gen2_hz.getValue() < 390) {
|
||||
if (systems.ELEC.Source.IDG2.hertz.getValue() > 410 or systems.ELEC.Source.IDG2.hertz.getValue() < 390) {
|
||||
me["Gen2Hz"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["Gen2Hz"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -1653,7 +1618,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["APUGentext"].setColor(0.8078,0.8039,0.8078);
|
||||
} else {
|
||||
me["APU-border"].show();
|
||||
if (gen_apu.getValue() == 0) {
|
||||
if (systems.ELEC.Source.APU.contact.getValue() == 0) {
|
||||
me["APU-content"].hide();
|
||||
me["APUGEN-off"].show();
|
||||
me["APUGentext"].setColor(0.7333,0.3803,0);
|
||||
|
@ -1661,15 +1626,15 @@ var canvas_lowerECAM_elec = {
|
|||
me["APU-content"].show();
|
||||
me["APUGEN-off"].hide();
|
||||
# me["APUGenLoad"].setText(sprintf("%s", math.round(apu_load.getValue())));
|
||||
me["APUGenVolt"].setText(sprintf("%s", math.round(apu_volts.getValue())));
|
||||
me["APUGenVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.volts.getValue())));
|
||||
|
||||
if (apu_hz.getValue() == 0) {
|
||||
if (systems.ELEC.Source.APU.hertz.getValue() == 0) {
|
||||
me["APUGenHz"].setText(sprintf("XX"));
|
||||
} else {
|
||||
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
|
||||
me["APUGenHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.APU.hertz.getValue())));
|
||||
}
|
||||
|
||||
if (apu_volts.getValue() > 120 or apu_volts.getValue() < 110 or apu_hz.getValue() > 410 or apu_hz.getValue() < 390 or apu_load.getValue() >= 110) {
|
||||
if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110 or systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390 or apu_load.getValue() >= 110) {
|
||||
me["APUGentext"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["APUGentext"].setColor(0.8078,0.8039,0.8078);
|
||||
|
@ -1681,13 +1646,13 @@ var canvas_lowerECAM_elec = {
|
|||
me["APUGenLoad"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (apu_volts.getValue() > 120 or apu_volts.getValue() < 110) {
|
||||
if (systems.ELEC.Source.APU.volts.getValue() > 120 or systems.ELEC.Source.APU.volts.getValue() < 110) {
|
||||
me["APUGenVolt"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["APUGenVolt"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (apu_hz.getValue() > 410 or apu_hz.getValue() < 390) {
|
||||
if (systems.ELEC.Source.APU.hertz.getValue() > 410 or systems.ELEC.Source.APU.hertz.getValue() < 390) {
|
||||
me["APUGenHz"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["APUGenHz"].setColor(0.0509,0.7529,0.2941);
|
||||
|
@ -1701,29 +1666,29 @@ var canvas_lowerECAM_elec = {
|
|||
me["EXTPWR-group"].hide();
|
||||
} else {
|
||||
me["EXTPWR-group"].show();
|
||||
me["ExtVolt"].setText(sprintf("%s", math.round(ext_volts.getValue())));
|
||||
me["ExtHz"].setText(sprintf("%s", math.round(ext_hz.getValue())));
|
||||
me["ExtVolt"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.volts.getValue())));
|
||||
me["ExtHz"].setText(sprintf("%s", math.round(systems.ELEC.Source.Ext.hertz.getValue())));
|
||||
|
||||
if (ext_hz.getValue() > 410 or ext_hz.getValue() < 390 or ext_volts.getValue() > 120 or ext_volts.getValue() < 110) {
|
||||
if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390 or systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) {
|
||||
me["EXTPWR-label"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["EXTPWR-label"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (ext_hz.getValue() > 410 or ext_hz.getValue() < 390) {
|
||||
if (systems.ELEC.Source.Ext.hertz.getValue() > 410 or systems.ELEC.Source.Ext.hertz.getValue() < 390) {
|
||||
me["ExtHz"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["ExtHz"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
|
||||
if (ext_volts.getValue() > 120 or ext_volts.getValue() < 110) {
|
||||
if (systems.ELEC.Source.Ext.volts.getValue() > 120 or systems.ELEC.Source.Ext.volts.getValue() < 110) {
|
||||
me["ExtVolt"].setColor(0.7333,0.3803,0);
|
||||
} else {
|
||||
me["ExtVolt"].setColor(0.0509,0.7529,0.2941);
|
||||
}
|
||||
}
|
||||
|
||||
if (galleyshed.getValue()) {
|
||||
if (systems.ELEC.SomeThing.galley.getValue()) {
|
||||
me["GalleyShed"].show();
|
||||
} else {
|
||||
me["GalleyShed"].hide();
|
||||
|
@ -1780,25 +1745,25 @@ var canvas_lowerECAM_elec = {
|
|||
|
||||
|
||||
# Managment of the connecting lines between the components
|
||||
if (getprop("/systems/electrical/relay/apu-glc/contact-pos") and (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") or getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"))) {
|
||||
if (systems.ELEC.Relay.apuGlc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) {
|
||||
me["APU-out"].show();
|
||||
} else {
|
||||
me["APU-out"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ext-epc/contact-pos") and (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") or getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos"))) {
|
||||
if (systems.ELEC.Relay.extEpc.getValue() and (systems.ELEC.Relay.acTie1.getValue() or systems.ELEC.Relay.acTie2.getValue())) {
|
||||
me["EXT-out"].show();
|
||||
} else {
|
||||
me["EXT-out"].hide();
|
||||
}
|
||||
|
||||
if (gen1_volts.getValue() >= 110 and getprop("/systems/electrical/relay/gen-1-glc/contact-pos")) {
|
||||
if (systems.ELEC.Source.IDG1.volts.getValue() >= 110 and systems.ELEC.Relay.glc1.getValue()) {
|
||||
me["ELEC-Line-GEN1-AC1"].show();
|
||||
} else {
|
||||
me["ELEC-Line-GEN1-AC1"].hide();
|
||||
}
|
||||
|
||||
if (gen2_volts.getValue() >= 110 and getprop("/systems/electrical/relay/gen-2-glc/contact-pos")) {
|
||||
if (systems.ELEC.Source.IDG2.volts.getValue() >= 110 and systems.ELEC.Relay.glc2.getValue()) {
|
||||
me["ELEC-Line-GEN2-AC2"].show();
|
||||
} else {
|
||||
me["ELEC-Line-GEN2-AC2"].hide();
|
||||
|
@ -1816,38 +1781,38 @@ var canvas_lowerECAM_elec = {
|
|||
me["AC2-in"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") and getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos")) {
|
||||
if (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.acTie2.getValue()) {
|
||||
me["ELEC-Line-APU-AC1"].show();
|
||||
me["ELEC-Line-APU-EXT"].show();
|
||||
me["ELEC-Line-EXT-AC2"].show();
|
||||
} else {
|
||||
if (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos")) {
|
||||
if (systems.ELEC.Relay.acTie1.getValue()) {
|
||||
me["ELEC-Line-APU-AC1"].show();
|
||||
} else {
|
||||
me["ELEC-Line-APU-AC1"].hide();
|
||||
}
|
||||
|
||||
if ((getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos") and getprop("/systems/electrical/relay/apu-glc/contact-pos") and !getprop("/systems/electrical/relay/gen-2-glc/contact-pos")) or (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-1/contact-pos") and getprop("/systems/electrical/relay/ext-epc/contact-pos") and !getprop("/systems/electrical/relay/gen-1-glc/contact-pos"))) {
|
||||
if ((systems.ELEC.Relay.acTie2.getValue() and systems.ELEC.Relay.apuGlc.getValue() and !systems.ELEC.Relay.glc2.getValue()) or (systems.ELEC.Relay.acTie1.getValue() and systems.ELEC.Relay.extEpc.getValue() and !systems.ELEC.Relay.glc1.getValue())) {
|
||||
me["ELEC-Line-APU-EXT"].show();
|
||||
} else {
|
||||
me["ELEC-Line-APU-EXT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-bus-ac-bus-tie-2/contact-pos")) {
|
||||
if (systems.ELEC.Relay.acTie2.getValue()) {
|
||||
me["ELEC-Line-EXT-AC2"].show();
|
||||
} else {
|
||||
me["ELEC-Line-EXT-AC2"].hide();
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-ess-feed-1/contact-pos") == 1) {
|
||||
if (systems.ELEC.Relay.acEssFeed1.getValue()) {
|
||||
if (systems.ELEC.Bus.ac1.getValue() >= 110) {
|
||||
me["ELEC-Line-AC1-ACESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-AC1-ACESS"].hide();
|
||||
}
|
||||
me["ELEC-Line-AC2-ACESS"].hide();
|
||||
} elsif (getprop("/systems/electrical/relay/ac-ess-feed-2/contact-pos") == 1) {
|
||||
} elsif (systems.ELEC.Relay.acEssFeed2.getValue()) {
|
||||
me["ELEC-Line-AC1-ACESS"].hide();
|
||||
if (systems.ELEC.Bus.ac2.getValue() >= 110) {
|
||||
me["ELEC-Line-AC2-ACESS"].show();
|
||||
|
@ -1859,7 +1824,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-AC2-ACESS"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/tr-contactor-1/contact-pos") == 1) {
|
||||
if (systems.ELEC.Relay.tr1Contactor.getValue()) {
|
||||
if (systems.ELEC.Bus.ac1.getValue() < 110) {
|
||||
me["ELEC-Line-AC1-TR1"].setColorFill(0.7333,0.3803,0);
|
||||
} else {
|
||||
|
@ -1872,7 +1837,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-TR1-DC1"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/tr-contactor-2/contact-pos") == 1) {
|
||||
if (systems.ELEC.Relay.tr2Contactor.getValue()) {
|
||||
if (systems.ELEC.Bus.ac2.getValue() < 110) {
|
||||
me["ELEC-Line-AC2-TR2"].setColorFill(0.7333,0.3803,0);
|
||||
} else {
|
||||
|
@ -1885,25 +1850,25 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-TR2-DC2"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos")) {
|
||||
if (systems.ELEC.Relay.dcTie1.getValue()) {
|
||||
me["ELEC-Line-DC1-DCESS_DCBAT"].show();
|
||||
} else {
|
||||
me["ELEC-Line-DC1-DCESS_DCBAT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-ess-feed-bat/contact-pos")) {
|
||||
if (systems.ELEC.Relay.dcEssFeedBat.getValue()) {
|
||||
me["ELEC-Line-DC1-DCESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-DC1-DCESS"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-ess-feed-bat/contact-pos") or getprop("/systems/electrical/relay/dc-bus-tie-dc-1/contact-pos")) {
|
||||
if (systems.ELEC.Relay.dcEssFeedBat.getValue() or systems.ELEC.Relay.dcTie1.getValue()) {
|
||||
me["ELEC-Line-DC1-DCBAT"].show();
|
||||
} else {
|
||||
me["ELEC-Line-DC1-DCBAT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-bus-tie-dc-2/contact-pos")) {
|
||||
if (systems.ELEC.Relay.dcTie2.getValue()) {
|
||||
me["ELEC-Line-DC2-DCBAT"].show();
|
||||
me["ELEC-Line-DC2-DCESS_DCBAT"].show();
|
||||
} else {
|
||||
|
@ -1911,7 +1876,7 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-DC2-DCESS_DCBAT"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos")) {
|
||||
if (systems.ELEC.Relay.acEssEmerGenFeed.getValue()) {
|
||||
me["EMERGEN-out"].show();
|
||||
me["ELEC-Line-Emergen-ESSTR"].show();
|
||||
} else {
|
||||
|
@ -1919,13 +1884,13 @@ var canvas_lowerECAM_elec = {
|
|||
me["ELEC-Line-Emergen-ESSTR"].hide();
|
||||
}
|
||||
|
||||
if (systems.ELEC.Bus.acEss.getValue() >= 110 and !getprop("/systems/electrical/relay/ac-ess-feed-emer-gen/contact-pos") and (!getprop("/systems/electrical/relay/tr-contactor-1/contact-pos") or !getprop("/systems/electrical/relay/tr-contactor-2/contact-pos"))) {
|
||||
if (systems.ELEC.Bus.acEss.getValue() >= 110 and !systems.ELEC.Relay.acEssEmerGenFeed.getValue() and (!systems.ELEC.Relay.tr1Contactor.getValue() or !systems.ELEC.Relay.tr2Contactor.getValue())) {
|
||||
me["ELEC-Line-ACESS-TRESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-ACESS-TRESS"].hide();
|
||||
}
|
||||
|
||||
if (getprop("/systems/electrical/relay/dc-ess-feed-tr/contact-pos")) {
|
||||
if (systems.ELEC.Relay.essTrContactor.getValue()) {
|
||||
me["ELEC-Line-ESSTR-DCESS"].show();
|
||||
} else {
|
||||
me["ELEC-Line-ESSTR-DCESS"].hide();
|
||||
|
@ -1988,7 +1953,7 @@ var canvas_lowerECAM_eng = {
|
|||
me["OilPSI2-needle"].setRotation((oil_psi2.getValue() + 90) * D2R);
|
||||
|
||||
# Fuel Used
|
||||
if (acconfig_weight_kgs.getValue() == 1) {
|
||||
if (acconfig_weight_kgs.getValue()) {
|
||||
me["FUEL-used-1"].setText(sprintf("%s", math.round(fuel_used_lbs1.getValue() * LBS2KGS, 10)));
|
||||
me["FUEL-used-2"].setText(sprintf("%s", math.round(fuel_used_lbs2.getValue() * LBS2KGS, 10)));
|
||||
me["Fused-weight-unit"].setText("KG");
|
||||
|
@ -2302,7 +2267,7 @@ var canvas_lowerECAM_fctl = {
|
|||
if (elac1.getValue()) {
|
||||
me["elac1"].setColor(0.0509,0.7529,0.2941);
|
||||
me["path4249"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if ((elac1.getValue() == 0) or (elac1_fail.getValue() == 1)) {
|
||||
} else if ((elac1.getValue() == 0) or (elac1_fail.getValue())) {
|
||||
me["elac1"].setColor(0.7333,0.3803,0);
|
||||
me["path4249"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
@ -2310,7 +2275,7 @@ var canvas_lowerECAM_fctl = {
|
|||
if (elac2.getValue()) {
|
||||
me["elac2"].setColor(0.0509,0.7529,0.2941);
|
||||
me["path4249-3"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if ((elac2.getValue() == 0) or (elac2_fail.getValue() == 1)) {
|
||||
} else if ((elac2.getValue() == 0) or (elac2_fail.getValue())) {
|
||||
me["elac2"].setColor(0.7333,0.3803,0);
|
||||
me["path4249-3"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
@ -2318,7 +2283,7 @@ var canvas_lowerECAM_fctl = {
|
|||
if (sec1.getValue()) {
|
||||
me["sec1"].setColor(0.0509,0.7529,0.2941);
|
||||
me["path4249-3-6-7"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if ((sec1.getValue() == 0) or (sec1_fail.getValue() == 1)) {
|
||||
} else if ((sec1.getValue() == 0) or (sec1_fail.getValue())) {
|
||||
me["sec1"].setColor(0.7333,0.3803,0);
|
||||
me["path4249-3-6-7"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
@ -2326,7 +2291,7 @@ var canvas_lowerECAM_fctl = {
|
|||
if (sec2.getValue()) {
|
||||
me["sec2"].setColor(0.0509,0.7529,0.2941);
|
||||
me["path4249-3-6-7-5"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if ((sec2.getValue() == 0) or (sec2_fail.getValue() == 1)) {
|
||||
} else if ((sec2.getValue() == 0) or (sec2_fail.getValue())) {
|
||||
me["sec2"].setColor(0.7333,0.3803,0);
|
||||
me["path4249-3-6-7-5"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
@ -2334,7 +2299,7 @@ var canvas_lowerECAM_fctl = {
|
|||
if (sec3.getValue()) {
|
||||
me["sec3"].setColor(0.0509,0.7529,0.2941);
|
||||
me["path4249-3-6"].setColor(0.0509,0.7529,0.2941);
|
||||
} else if ((sec3.getValue() == 0) or (sec3_fail.getValue() == 1)) {
|
||||
} else if ((sec3.getValue() == 0) or (sec3_fail.getValue())) {
|
||||
me["sec3"].setColor(0.7333,0.3803,0);
|
||||
me["path4249-3-6"].setColor(0.7333,0.3803,0);
|
||||
}
|
||||
|
@ -2406,7 +2371,6 @@ var canvas_lowerECAM_fuel = {
|
|||
update: func() {
|
||||
_weight_kgs = acconfig_weight_kgs.getValue();
|
||||
|
||||
# if (getprop("/engines/engine[0]/n1-actual") < getprop("/controls/engines/idle-limit")) {
|
||||
if (eng1_n1.getValue() <= 18.8) {
|
||||
me["ENG1idFFlow"].setColor(0.7333,0.3803,0);
|
||||
me["FUEL-ENG-1-label"].setColor(0.7333,0.3803,0);
|
||||
|
@ -2415,7 +2379,6 @@ var canvas_lowerECAM_fuel = {
|
|||
me["FUEL-ENG-1-label"].setColor(0.8078,0.8039,0.8078);
|
||||
}
|
||||
|
||||
# if (getprop("/engines/engine[1]/n1-actual") < getprop("/controls/engines/idle-limit")) {
|
||||
if (eng2_n1.getValue() <= 18.5) {
|
||||
me["ENG2idFFlow"].setColor(0.7333,0.3803,0);
|
||||
me["FUEL-ENG-2-label"].setColor(0.7333,0.3803,0);
|
||||
|
@ -2440,7 +2403,7 @@ var canvas_lowerECAM_fuel = {
|
|||
me["FFlow-weight-unit"].setText("LBS/MIN");
|
||||
}
|
||||
|
||||
if (fadec1.getValue() == 1 and fadec2.getValue() == 1) {
|
||||
if (fadec1.getValue() and fadec2.getValue() or fadecPowerUp.getValue()) {
|
||||
me["FUEL-Flow-per-min"].setColor(0.0509,0.7529,0.2941);
|
||||
if (_weight_kgs == 1) {
|
||||
me["FUEL-Flow-per-min"].setText(sprintf("%s", math.round(((fuel_flow1.getValue() + fuel_flow2.getValue()) * LBS2KGS) / 60, 10)));
|
||||
|
@ -2454,7 +2417,7 @@ var canvas_lowerECAM_fuel = {
|
|||
|
||||
# TODO use the valve prop and add amber if difference between eng master and valve
|
||||
# TODO add transition state
|
||||
if (systems.FUEL.Valves.lpValve1.getValue() == 1) {
|
||||
if (systems.FUEL.Valves.lpValve1.getValue()) {
|
||||
me["FUEL-ENG-Master-1"].setRotation(0);
|
||||
me["FUEL-ENG-Master-1"].setColor(0.0509,0.7529,0.2941);
|
||||
me["FUEL-ENG-Master-1"].setColorFill(0.0509,0.7529,0.2941);
|
||||
|
@ -2468,7 +2431,7 @@ var canvas_lowerECAM_fuel = {
|
|||
|
||||
# TODO use the valve prop and add amber if difference between eng master and valve
|
||||
# TODO add transition state
|
||||
if (systems.FUEL.Valves.lpValve2.getValue() == 1) {
|
||||
if (systems.FUEL.Valves.lpValve2.getValue()) {
|
||||
me["FUEL-ENG-Master-2"].setRotation(0);
|
||||
me["FUEL-ENG-Master-2"].setColor(0.0509,0.7529,0.2941);
|
||||
me["FUEL-ENG-Master-2"].setColorFill(0.0509,0.7529,0.2941);
|
||||
|
@ -2608,7 +2571,7 @@ var canvas_lowerECAM_fuel = {
|
|||
if (systems.FUEL.Valves.transfer1.getValue() == 0) {
|
||||
me["FUEL-Left-Transfer"].hide();
|
||||
} else {
|
||||
if (systems.FUEL.Valves.transfer1.getValue() == 1) {
|
||||
if (systems.FUEL.Valves.transfer1.getValue()) {
|
||||
me["FUEL-Left-Transfer"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["FUEL-Left-Transfer"].setColor(0.7333,0.3803,0);
|
||||
|
@ -2619,7 +2582,7 @@ var canvas_lowerECAM_fuel = {
|
|||
if (systems.FUEL.Valves.transfer2.getValue() == 0) {
|
||||
me["FUEL-Right-Transfer"].hide();
|
||||
} else {
|
||||
if (systems.FUEL.Valves.transfer2.getValue() == 1) {
|
||||
if (systems.FUEL.Valves.transfer2.getValue()) {
|
||||
me["FUEL-Right-Transfer"].setColor(0.0509,0.7529,0.2941);
|
||||
} else {
|
||||
me["FUEL-Right-Transfer"].setColor(0.7333,0.3803,0);
|
||||
|
@ -2634,13 +2597,13 @@ var canvas_lowerECAM_fuel = {
|
|||
}
|
||||
|
||||
# APU
|
||||
if (systems.FUEL.Valves.apu.getValue() == 1 and systems.APUNodes.Controls.master.getValue() and !systems.APUNodes.Controls.fire.getValue()) {
|
||||
if (systems.FUEL.Valves.apu.getValue() and systems.APUNodes.Controls.master.getValue() and !systems.APUNodes.Controls.fire.getValue()) {
|
||||
me["FUEL-APU-label"].setColor(0.8078, 0.8039, 0.8078);
|
||||
me["FUEL-APU-line"].setColor(0.0509,0.7529,0.2941);
|
||||
me["FUEL-APU-arrow"].setColor(0.0509,0.7529,0.2941);
|
||||
me["FUEL-APU-line"].show();
|
||||
me["FUEL-APU-arrow"].show();
|
||||
} elsif (systems.FUEL.Valves.apu.getValue() == 1 and (!systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) {
|
||||
} elsif (systems.FUEL.Valves.apu.getValue() and (!systems.APUNodes.Controls.master.getValue() or systems.APUNodes.Controls.fire.getValue())) {
|
||||
me["FUEL-APU-label"].setColor(0.7333,0.3803,0);
|
||||
me["FUEL-APU-line"].setColor(0.7333,0.3803,0);
|
||||
me["FUEL-APU-arrow"].setColor(0.7333,0.3803,0);
|
||||
|
@ -2886,37 +2849,37 @@ var canvas_lowerECAM_hyd = {
|
|||
}
|
||||
}
|
||||
|
||||
if (y_resv_lo_air_press.getValue() == 1) {
|
||||
if (y_resv_lo_air_press.getValue()) {
|
||||
me["LO-AIR-PRESS-Yellow"].show();
|
||||
} else {
|
||||
me["LO-AIR-PRESS-Yellow"].hide();
|
||||
}
|
||||
|
||||
if (b_resv_lo_air_press.getValue() == 1) {
|
||||
if (b_resv_lo_air_press.getValue()) {
|
||||
me["LO-AIR-PRESS-Blue"].show();
|
||||
} else {
|
||||
me["LO-AIR-PRESS-Blue"].hide();
|
||||
}
|
||||
|
||||
if (g_resv_lo_air_press.getValue() == 1) {
|
||||
if (g_resv_lo_air_press.getValue()) {
|
||||
me["LO-AIR-PRESS-Green"].show();
|
||||
} else {
|
||||
me["LO-AIR-PRESS-Green"].hide();
|
||||
}
|
||||
|
||||
if (elec_pump_y_ovht.getValue() == 1) {
|
||||
if (elec_pump_y_ovht.getValue()) {
|
||||
me["ELEC-OVHT-Yellow"].show();
|
||||
} else {
|
||||
me["ELEC-OVHT-Yellow"].hide();
|
||||
}
|
||||
|
||||
if (elec_pump_b_ovht.getValue() == 1) {
|
||||
if (elec_pump_b_ovht.getValue()) {
|
||||
me["ELEC-OVHT-Blue"].show();
|
||||
} else {
|
||||
me["ELEC-OVHT-Blue"].hide();
|
||||
}
|
||||
|
||||
if (systems.HYD.Rat.position.getValue() == 1) {
|
||||
if (systems.HYD.Rat.position.getValue()) {
|
||||
me["RAT-stowed"].hide();
|
||||
me["RAT-not-stowed"].show();
|
||||
} else {
|
||||
|
@ -2924,19 +2887,19 @@ var canvas_lowerECAM_hyd = {
|
|||
me["RAT-not-stowed"].hide();
|
||||
}
|
||||
|
||||
if (y_resv_ovht.getValue() == 1) {
|
||||
if (y_resv_ovht.getValue()) {
|
||||
me["OVHT-Yellow"].show();
|
||||
} else {
|
||||
me["OVHT-Yellow"].hide();
|
||||
}
|
||||
|
||||
if (b_resv_ovht.getValue() == 1) {
|
||||
if (b_resv_ovht.getValue()) {
|
||||
me["OVHT-Green"].show();
|
||||
} else {
|
||||
me["OVHT-Green"].hide();
|
||||
}
|
||||
|
||||
if (g_resv_ovht.getValue() == 1) {
|
||||
if (g_resv_ovht.getValue()) {
|
||||
me["OVHT-Blue"].show();
|
||||
} else {
|
||||
me["OVHT-Blue"].hide();
|
||||
|
@ -3592,13 +3555,13 @@ setlistener("sim/signals/fdm-initialized", func {
|
|||
lowerECAM_test = canvas_lowerECAM_test.new(group_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg");
|
||||
|
||||
lowerECAM_update.start();
|
||||
if (getprop("/systems/acconfig/options/lecam-rate") > 1) {
|
||||
if (rate.getValue() > 1) {
|
||||
l_rateApply();
|
||||
}
|
||||
});
|
||||
|
||||
var l_rateApply = func {
|
||||
lowerECAM_update.restart(0.05 * getprop("/systems/acconfig/options/lecam-rate"));
|
||||
lowerECAM_update.restart(0.05 * rate.getValue());
|
||||
}
|
||||
|
||||
var lowerECAM_update = maketimer(0.05, func {
|
||||
|
|
|
@ -7204,14 +7204,37 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<condition>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/dc-ess</property>
|
||||
<value>25</value>
|
||||
</greater-than-equals>
|
||||
<and>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/dc-ess</property>
|
||||
<value>25</value>
|
||||
</greater-than-equals>
|
||||
<or>
|
||||
<not>
|
||||
<property>gear/gear[1]/wow</property>
|
||||
</not>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>3</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>3</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<command>property-toggle</command>
|
||||
<command>property-assign</command>
|
||||
<property>controls/switches/LrainRpt</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>controls/switches/LrainRpt</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("sim/sounde/oh-btn", 1);</script>
|
||||
|
@ -7227,14 +7250,37 @@
|
|||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<condition>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/dc-ess</property>
|
||||
<value>25</value>
|
||||
</greater-than-equals>
|
||||
<and>
|
||||
<greater-than-equals>
|
||||
<property>systems/electrical/bus/dc-2</property>
|
||||
<value>25</value>
|
||||
</greater-than-equals>
|
||||
<or>
|
||||
<not>
|
||||
<property>gear/gear[1]/wow</property>
|
||||
</not>
|
||||
<equals>
|
||||
<property>/engines/engine[0]/state</property>
|
||||
<value>3</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/engines/engine[1]/state</property>
|
||||
<value>3</value>
|
||||
</equals>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<command>property-toggle</command>
|
||||
<command>property-assign</command>
|
||||
<property>controls/switches/RrainRpt</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>controls/switches/RrainRpt</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>setprop("sim/sounde/oh-btn", 1);</script>
|
||||
|
|
|
@ -236,14 +236,21 @@ var status = {
|
|||
var ECAM_controller = {
|
||||
_recallCounter: 0,
|
||||
_noneActive: 0,
|
||||
counter: 0,
|
||||
init: func() {
|
||||
ECAMloopTimer.start();
|
||||
me.counter = 0;
|
||||
me.reset();
|
||||
},
|
||||
loop: func() {
|
||||
if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !getprop("systems/acconfig/acconfig-running")) {
|
||||
if ((systems.ELEC.Bus.acEss.getValue() >= 110 or systems.ELEC.Bus.ac2.getValue() >= 110) and !pts.Acconfig.running.getBoolValue()) {
|
||||
# update FWC phases
|
||||
phaseLoop();
|
||||
if (me.counter == 0) {
|
||||
phaseLoop();
|
||||
me.counter = 1;
|
||||
return;
|
||||
}
|
||||
me.counter = 0;
|
||||
|
||||
# check active messages
|
||||
messages_priority_3();
|
||||
|
@ -274,7 +281,7 @@ var ECAM_controller = {
|
|||
# write to ECAM
|
||||
var counter = 0;
|
||||
|
||||
if (!getprop("systems/acconfig/autoconfig-running")) {
|
||||
if (!pts.Acconfig.running.getBoolValue()) {
|
||||
foreach (var w; warnings.vector) {
|
||||
if (w.active == 1) {
|
||||
if (counter < 9) {
|
||||
|
|
|
@ -116,14 +116,14 @@ var phaseLoop = func() {
|
|||
|
||||
if (eng == "IAE") {
|
||||
eprlim = getprop("controls/engines/epr-limit");
|
||||
if ((!getprop("controls/engines/engine[0]/reverser") and !getprop("controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Output.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
|
||||
if ((!pts.Controls.Engines.Engine.reverser[0].getBoolValue() and !pts.Controls.Engines.Engine.reverser[1].getBoolValue()) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Output.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
|
||||
FWC.toPower.setBoolValue(1);
|
||||
} else {
|
||||
FWC.toPower.setBoolValue(0);
|
||||
}
|
||||
} else {
|
||||
n1lim = getprop("controls/engines/n1-limit");
|
||||
if ((!getprop("controls/engines/engine[0]/reverser") and !getprop("controls/engines/engine[1]/reverser")) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Output.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
|
||||
if ((!pts.Controls.Engines.Engine.reverser[0].getBoolValue() and !pts.Controls.Engines.Engine.reverser[1].getBoolValue()) and (((pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.78 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.779) and fadec.Output.limFlex.getBoolValue()) or (pts.Controls.Engines.Engine.throttle[0].getValue() >= 0.99 or pts.Controls.Engines.Engine.throttle[1].getValue() >= 0.99))) {
|
||||
FWC.toPower.setBoolValue(1);
|
||||
} else {
|
||||
FWC.toPower.setBoolValue(0);
|
||||
|
|
|
@ -197,15 +197,15 @@ var light_manager = {
|
|||
var sh = math.sin(heading);
|
||||
var ch = math.cos(heading);
|
||||
|
||||
if ((ll1 == 1 and getprop("systems/electrical/bus/ac-1") != 0) and (ll2 == 1 and getprop("systems/electrical/bus/ac-2") !=0)) {
|
||||
if ((ll1 == 1 and systems.ELEC.Bus.ac1.getValue() != 0) and (ll2 == 1 and systems.ELEC.Bus.ac2.getValue() != 0)) {
|
||||
me.light1_ypos = 0.0;
|
||||
me.light1_setSize(16);
|
||||
me.light1_on();
|
||||
} else if (ll1 == 1 and getprop("systems/electrical/bus/ac-1") != 0) {
|
||||
} else if (ll1 == 1 and systems.ELEC.Bus.ac1.getValue() != 0) {
|
||||
me.light1_ypos = 3.0;
|
||||
me.light1_setSize(12);
|
||||
me.light1_on();
|
||||
} else if (ll2 == 1 and getprop("systems/electrical/bus/ac-2") !=0) {
|
||||
} else if (ll2 == 1 and systems.ELEC.Bus.ac2.getValue() != 0) {
|
||||
me.light1_ypos = -3.0;
|
||||
me.light1_setSize(12);
|
||||
me.light1_on();
|
||||
|
|
|
@ -157,13 +157,13 @@ var FCUController = {
|
|||
if (ap1.getBoolValue() or ap2.getBoolValue()) {
|
||||
apOff("soft", 0);
|
||||
} else {
|
||||
if (getprop("it-autoflight/sound/apoffsound") == 1 or getprop("it-autoflight/sound/apoffsound2") == 1) {
|
||||
setprop("it-autoflight/sound/apoffsound", 0);
|
||||
setprop("it-autoflight/sound/apoffsound2", 0);
|
||||
if (getprop("/it-autoflight/sound/apoffsound") == 1 or getprop("/it-autoflight/sound/apoffsound2") == 1) {
|
||||
setprop("/it-autoflight/sound/apoffsound", 0);
|
||||
setprop("/it-autoflight/sound/apoffsound2", 0);
|
||||
}
|
||||
if (getprop("it-autoflight/output/ap-warning") != 0) {
|
||||
setprop("it-autoflight/output/ap-warning", 0);
|
||||
setprop("ECAM/warnings/master-warning-light", 0);
|
||||
if (getprop("/it-autoflight/output/ap-warning") != 0) {
|
||||
setprop("/it-autoflight/output/ap-warning", 0);
|
||||
ecam.lights[0].setValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -178,11 +178,11 @@ var FCUController = {
|
|||
if (me.FCUworking) {
|
||||
if (athr.getBoolValue()) {
|
||||
athrOff("soft");
|
||||
setprop("ECAM/warnings/master-caution-light", 1);
|
||||
ecam.lights[1].setValue(1);
|
||||
} else {
|
||||
if (getprop("it-autoflight/output/athr-warning") == 1) {
|
||||
setprop("it-autoflight/output/athr-warning", 0);
|
||||
setprop("ECAM/warnings/master-caution-light", 0);
|
||||
if (getprop("/it-autoflight/output/athr-warning") == 1) {
|
||||
setprop("/it-autoflight/output/athr-warning", 0);
|
||||
ecam.lights[1].setValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ var FCUController = {
|
|||
},
|
||||
ALTPush: func() {
|
||||
if (me.FCUworking) {
|
||||
# setprop("it-autoflight/input/vert", 8); # He don't work yet m8
|
||||
# setprop("/it-autoflight/input/vert", 8); # He don't work yet m8
|
||||
}
|
||||
},
|
||||
ALTPull: func() {
|
||||
|
@ -523,7 +523,7 @@ var athrOff = func(type) {
|
|||
var hdgInput = func {
|
||||
if (latMode.getValue() != 0) {
|
||||
showHDG.setBoolValue(1);
|
||||
var hdgnow = getprop("it-autoflight/input/hdg");
|
||||
setprop("modes/fcu/hdg-time", getprop("sim/time/elapsed-sec"));
|
||||
var hdgnow = getprop("/it-autoflight/input/hdg");
|
||||
setprop("/modes/fcu/hdg-time", pts.Sim.Time.elapsedSec.getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1015,12 +1015,6 @@ var reset_FMGC = func {
|
|||
setprop("systems/pressurization/diff-to-target", "0");
|
||||
setprop("systems/pressurization/ditchingpb", 0);
|
||||
setprop("systems/pressurization/targetvs", "0");
|
||||
setprop("systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
setprop("systems/ventilation/avionics/fan", 0);
|
||||
setprop("systems/ventilation/avionics/extractvalve", "0");
|
||||
setprop("systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("systems/ventilation/lavatory/extractvalve", "0");
|
||||
setprop("systems/pressurization/ambientpsi", "0");
|
||||
setprop("systems/pressurization/cabinpsi", "0");
|
||||
|
||||
|
|
|
@ -5,77 +5,71 @@
|
|||
|
||||
var wow = nil;
|
||||
var wowr = nil;
|
||||
var Lrain = props.globals.getNode("/controls/switches/LrainRpt");
|
||||
var Rrain = props.globals.getNode("/controls/switches/RrainRpt");
|
||||
var OnLt = props.globals.getNode("/controls/switches/emerCallLtO");
|
||||
var CallLt = props.globals.getNode("/controls/switches/emerCallLtC");
|
||||
var EmerCall = props.globals.getNode("/controls/switches/emerCall");
|
||||
var CabinCall = props.globals.getNode("/controls/switches/cabinCall");
|
||||
var MechCall = props.globals.getNode("/controls/switches/mechCall");
|
||||
var cvr_gndCtl = props.globals.getNode("/controls/CVR/gndctl");
|
||||
var cvr_power = props.globals.getNode("/controls/CVR/power");
|
||||
var cvr_tone = props.globals.getNode("/controls/CVR/tone");
|
||||
|
||||
# Resets buttons to the default values
|
||||
var variousReset = func {
|
||||
setprop("modes/cpt-du-xfr", 0);
|
||||
setprop("modes/fo-du-xfr", 0);
|
||||
setprop("controls/fadec/n1mode1", 0);
|
||||
setprop("controls/fadec/n1mode2", 0);
|
||||
setprop("/controls/fadec/n1mode1", 0);
|
||||
setprop("/controls/fadec/n1mode2", 0);
|
||||
setprop("instrumentation/mk-viii/serviceable", 1);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/gpws-inhibit", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/glideslope-inhibit", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override", 0);
|
||||
setprop("instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override", 0);
|
||||
setprop("controls/switches/cabinCall", 0);
|
||||
setprop("controls/switches/mechCall", 0);
|
||||
setprop("controls/switches/emer-lights", 0.5);
|
||||
setprop("/controls/switches/cabinCall", 0);
|
||||
setprop("/controls/switches/mechCall", 0);
|
||||
setprop("/controls/switches/emer-lights", 0.5);
|
||||
# cockpit voice recorder stuff
|
||||
setprop("controls/CVR/power", 0);
|
||||
setprop("controls/CVR/test", 0);
|
||||
setprop("controls/CVR/tone", 0);
|
||||
setprop("controls/CVR/gndctl", 0);
|
||||
setprop("controls/CVR/erase", 0);
|
||||
setprop("controls/switches/pneumatics/cabin-fans", 1);
|
||||
setprop("controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
|
||||
setprop("controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
|
||||
setprop("controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
|
||||
setprop("controls/switches/emerCall", 0);
|
||||
setprop("controls/switches/LrainRpt", 0);
|
||||
setprop("controls/switches/RrainRpt", 0);
|
||||
setprop("controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("controls/lighting/strobe", 0);
|
||||
setprop("controls/lighting/beacon", 0);
|
||||
setprop("controls/switches/beacon", 0);
|
||||
setprop("controls/switches/wing-lights", 0);
|
||||
setprop("controls/switches/landing-lights-l", 0);
|
||||
setprop("controls/switches/landing-lights-r", 0);
|
||||
setprop("controls/lighting/wing-lights", 0);
|
||||
setprop("controls/lighting/nav-lights-switch", 0);
|
||||
setprop("controls/lighting/landing-lights[1]", 0);
|
||||
setprop("controls/lighting/landing-lights[2]", 0);
|
||||
setprop("controls/lighting/taxi-light-switch", 0);
|
||||
setprop("controls/lighting/DU/du1", 1);
|
||||
setprop("controls/lighting/DU/du2", 1);
|
||||
setprop("controls/lighting/DU/du3", 1);
|
||||
setprop("controls/lighting/DU/du4", 1);
|
||||
setprop("controls/lighting/DU/du5", 1);
|
||||
setprop("controls/lighting/DU/du6", 1);
|
||||
setprop("controls/lighting/DU/mcdu1", 1);
|
||||
setprop("controls/lighting/DU/mcdu2", 1);
|
||||
setprop("/controls/CVR/power", 0);
|
||||
setprop("/controls/CVR/test", 0);
|
||||
setprop("/controls/CVR/tone", 0);
|
||||
setprop("/controls/CVR/gndctl", 0);
|
||||
setprop("/controls/CVR/erase", 0);
|
||||
setprop("/controls/switches/pneumatics/cabin-fans", 1);
|
||||
setprop("/controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
|
||||
setprop("/controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
|
||||
setprop("/controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
|
||||
setprop("/controls/switches/emerCall", 0);
|
||||
setprop("/controls/switches/LrainRpt", 0);
|
||||
setprop("/controls/switches/RrainRpt", 0);
|
||||
setprop("/controls/switches/wiperLspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("/controls/switches/wiperRspd", 0); # -1 = INTM 0 = OFF 1 = LO 2 = HI
|
||||
setprop("/controls/lighting/strobe", 0);
|
||||
setprop("/controls/lighting/beacon", 0);
|
||||
setprop("/controls/switches/beacon", 0);
|
||||
setprop("/controls/switches/wing-lights", 0);
|
||||
setprop("/controls/switches/landing-lights-l", 0);
|
||||
setprop("/controls/switches/landing-lights-r", 0);
|
||||
setprop("/controls/lighting/wing-lights", 0);
|
||||
setprop("/controls/lighting/nav-lights-switch", 0);
|
||||
setprop("/controls/lighting/landing-lights[1]", 0);
|
||||
setprop("/controls/lighting/landing-lights[2]", 0);
|
||||
setprop("/controls/lighting/taxi-light-switch", 0);
|
||||
setprop("/controls/lighting/DU/du1", 1);
|
||||
setprop("/controls/lighting/DU/du2", 1);
|
||||
setprop("/controls/lighting/DU/du3", 1);
|
||||
setprop("/controls/lighting/DU/du4", 1);
|
||||
setprop("/controls/lighting/DU/du5", 1);
|
||||
setprop("/controls/lighting/DU/du6", 1);
|
||||
setprop("/controls/lighting/DU/mcdu1", 1);
|
||||
setprop("/controls/lighting/DU/mcdu2", 1);
|
||||
setprop("modes/fcu/hdg-time", -45);
|
||||
setprop("controls/switching/ATTHDG", 0);
|
||||
setprop("controls/switching/AIRDATA", 0);
|
||||
setprop("controls/switches/no-smoking-sign", 1);
|
||||
setprop("controls/switches/seatbelt-sign", 1);
|
||||
setprop("/controls/switching/ATTHDG", 0);
|
||||
setprop("/controls/switching/AIRDATA", 0);
|
||||
setprop("/controls/switches/no-smoking-sign", 1);
|
||||
setprop("/controls/switches/seatbelt-sign", 1);
|
||||
}
|
||||
|
||||
var BUTTONS = {
|
||||
update: func() {
|
||||
rainRepel();
|
||||
CVR_master();
|
||||
if (EmerCall.getValue()) {
|
||||
EmerCallOnLight();
|
||||
EmerCallLight();
|
||||
|
@ -83,17 +77,6 @@ var BUTTONS = {
|
|||
},
|
||||
};
|
||||
|
||||
var rainRepel = func() {
|
||||
if (pts.Engines.Engine.state[0].getValue() != 3 and pts.Engines.Engine.state[1].getValue() != 3 and pts.Gear.wow[0].getValue()) {
|
||||
if (Lrain.getValue()) {
|
||||
Lrain.setValue(0);
|
||||
}
|
||||
if (Rrain.getValue()) {
|
||||
Rrain.setValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var _OnLt = nil;
|
||||
var _EmerCall = nil;
|
||||
|
||||
|
@ -120,18 +103,6 @@ var EmerCallLight = func() {
|
|||
}
|
||||
}
|
||||
|
||||
var CVR_master = func() {
|
||||
wow = pts.Gear.wow[0].getValue();
|
||||
wowr = pts.Gear.wow[1].getValue();
|
||||
if (systems.ELEC.Bus.acEss.getValue() > 0 and wow and wowr and (cvr_gndCtl.getValue() or (pts.Engines.Engine.state[0].getValue() == 3 or pts.Engines.Engine.state[1].getValue() == 3))) {
|
||||
cvr_power.setValue(1);
|
||||
} else if (!wow and !wowr and systems.ELEC.Bus.acEss.getValue() > 0) {
|
||||
cvr_power.setValue(1);
|
||||
} else {
|
||||
cvr_power.setValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
var EmerCallFunc = func {
|
||||
EmerCall.setValue(1);
|
||||
settimer(func() {
|
||||
|
|
|
@ -210,6 +210,7 @@ var systemsInit = func {
|
|||
systems.ADIRS.init();
|
||||
systems.eng_init();
|
||||
systems.APUController.init();
|
||||
systems.BrakeSys.reset();
|
||||
systems.Autobrake.init();
|
||||
systems.fire_init();
|
||||
fmgc.flightPlanController.reset();
|
||||
|
@ -256,17 +257,17 @@ var systemsLoop = maketimer(0.1, func {
|
|||
systems.ELEC.loop();
|
||||
systems.PNEU.loop();
|
||||
systems.HYD.loop();
|
||||
systems.FUEL.loop();
|
||||
systems.ADIRS.loop();
|
||||
systems.APUController.loop();
|
||||
systems.BrakeSys.update();
|
||||
ecam.ECAM.loop();
|
||||
libraries.BUTTONS.update();
|
||||
fadec.FADEC.loop();
|
||||
rmp.rmpUpdate();
|
||||
fcu.FCUController.loop();
|
||||
dmc.DMController.loop();
|
||||
systems.APUController.loop();
|
||||
systems.HFLoop();
|
||||
atsu.ATSU.loop();
|
||||
libraries.BUTTONS.update();
|
||||
systems.HFLoop();
|
||||
|
||||
groundspeed = pts.Velocities.groundspeed.getValue();
|
||||
if ((groundAir.getBoolValue() or groundCart.getBoolValue()) and ((groundspeed > 2) or (!pts.Controls.Gear.parkingBrake.getBoolValue() and !chocks.getBoolValue()))) {
|
||||
|
@ -452,7 +453,7 @@ controls.elevatorTrim = func(d) {
|
|||
if (systems.HYD.Psi.green.getValue() >= 1500) {
|
||||
slewProp("/controls/flight/elevator-trim", d * 0.0185); # Rate in JSB normalized (0.125 / 13.5)
|
||||
} else {
|
||||
slewProp("/controls/flight/elevator-trim", d * 0.0092) # Rate in JSB normalized (0.125 / 13.5)
|
||||
slewProp("/controls/flight/elevator-trim", d * 0.0092) # Rate in JSB normalized (0.125 / 13.5)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ var Controls = {
|
|||
cutoffSw: [props.globals.getNode("/controls/engines/engine[0]/cutoff-switch"), props.globals.getNode("/controls/engines/engine[1]/cutoff-switch")],
|
||||
firePb: [props.globals.getNode("/controls/engines/engine[0]/fire-btn"), props.globals.getNode("/controls/engines/engine[1]/fire-btn")],
|
||||
throttle: [props.globals.getNode("/controls/engines/engine[0]/throttle"), props.globals.getNode("/controls/engines/engine[1]/throttle")],
|
||||
throttleRev: [props.globals.getNode("/controls/engines/engine[0]/throttle-rev"), props.globals.getNode("/controls/engines/engine[1]/throttle-rev")],
|
||||
reverser: [props.globals.getNode("/controls/engines/engine[0]/reverser"), props.globals.getNode("/controls/engines/engine[1]/reverser")],
|
||||
},
|
||||
},
|
||||
Flight: {
|
||||
|
@ -43,6 +45,7 @@ var Controls = {
|
|||
brake: [props.globals.getNode("/controls/gear/brake-left"),props.globals.getNode("/controls/gear/brake-right")],
|
||||
gearDown: props.globals.getNode("/controls/gear/gear-down"),
|
||||
parkingBrake: props.globals.getNode("/controls/gear/brake-parking"),
|
||||
chocks: props.globals.getNode("/services/chocks/enable"),
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -55,17 +58,20 @@ var Engines = {
|
|||
eprActual: [props.globals.getNode("/engines/engine[0]/epr-actual"), props.globals.getNode("/engines/engine[1]/epr-actual")],
|
||||
n1Actual: [props.globals.getNode("/engines/engine[0]/n1-actual"), props.globals.getNode("/engines/engine[1]/n1-actual")],
|
||||
n2Actual: [props.globals.getNode("/engines/engine[0]/n2-actual"), props.globals.getNode("/engines/engine[1]/n2-actual")],
|
||||
thrust: [props.globals.getNode("/engines/engine[0]/thrust-lb"), props.globals.getNode("/engines/engine[1]/thrust-lb")],
|
||||
state: [props.globals.getNode("/engines/engine[0]/state"), props.globals.getNode("/engines/engine[1]/state")],
|
||||
},
|
||||
};
|
||||
|
||||
var Environment = {
|
||||
magVar: props.globals.getNode("/environment/magnetic-variation-deg"),
|
||||
tempDegC: props.globals.getNode("/environment/temperature-degc"),
|
||||
};
|
||||
|
||||
var Fdm = {
|
||||
JSBsim: {
|
||||
Fcs: {
|
||||
brake: [props.globals.getNode("/fdm/jsbsim/fcs/left-brake-cmd-norm"),props.globals.getNode("/fdm/jsbsim/fcs/right-brake-cmd-norm")],
|
||||
flapDeg: props.globals.getNode("/fdm/jsbsim/fcs/flap-pos-deg"),
|
||||
slatDeg: props.globals.getNode("/fdm/jsbsim/fcs/slat-pos-deg"),
|
||||
},
|
||||
|
@ -73,12 +79,17 @@ var Fdm = {
|
|||
aileron: props.globals.getNode("/fdm/jsbsim/fbw/aileron-sidestick"),
|
||||
elevator: props.globals.getNode("/fdm/jsbsim/fbw/elevator-sidestick"),
|
||||
},
|
||||
Inertia: {
|
||||
weightLbs: props.globals.getNode("/fdm/jsbsim/inertia/weight-lbs"),
|
||||
},
|
||||
Position: {
|
||||
wow: props.globals.getNode("/fdm/jsbsim/position/wow"),
|
||||
},
|
||||
Propulsion: {
|
||||
tatC: props.globals.getNode("/fdm/jsbsim/propulsion/tat-c"),
|
||||
Engine: {
|
||||
fuelUsed: [props.globals.getNode("/fdm/jsbsim/propulsion/engine[0]/fuel-used-lbs"), props.globals.getNode("/fdm/jsbsim/propulsion/engine[1]/fuel-used-lbs")],
|
||||
reverserAngle: [props.globals.getNode("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad"), props.globals.getNode("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad")],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -92,9 +103,9 @@ var FMGC = {
|
|||
|
||||
var Gear = {
|
||||
compression: [props.globals.getNode("/gear/gear[0]/compression-norm"), props.globals.getNode("/gear/gear[1]/compression-norm"), props.globals.getNode("/gear/gear[2]/compression-norm")],
|
||||
wow: [props.globals.getNode("/gear/gear[0]/wow"), props.globals.getNode("/gear/gear[1]/wow"), props.globals.getNode("/gear/gear[2]/wow")],
|
||||
position: [props.globals.getNode("/gear/gear[0]/position-norm"), props.globals.getNode("/gear/gear[1]/position-norm"), props.globals.getNode("/gear/gear[2]/position-norm")],
|
||||
rollspeed: [props.globals.getNode("/gear/gear[0]/rollspeed-ms"), props.globals.getNode("/gear/gear[1]/rollspeed-ms"), props.globals.getNode("/gear/gear[2]/rollspeed-ms")],
|
||||
wow: [props.globals.getNode("/gear/gear[0]/wow"), props.globals.getNode("/gear/gear[1]/wow"), props.globals.getNode("/gear/gear[2]/wow")],
|
||||
};
|
||||
|
||||
var Instrumentation = {
|
||||
|
@ -160,6 +171,7 @@ var Sim = {
|
|||
online: props.globals.getNode("/sim/multiplay/online"),
|
||||
},
|
||||
pause: props.globals.getNode("/sim/freeze/master"),
|
||||
replayState: props.globals.getNode("/sim/freeze/replay-state"),
|
||||
Replay: {
|
||||
replayActive: props.globals.getNode("/sim/replay/replay-state"),
|
||||
},
|
||||
|
@ -169,8 +181,16 @@ var Sim = {
|
|||
},
|
||||
};
|
||||
|
||||
var Systems = {
|
||||
Thrust: {
|
||||
state: [props.globals.getNode("/systems/thrust/state1"), props.globals.getNode("/systems/thrust/state2")],
|
||||
},
|
||||
};
|
||||
|
||||
var Velocities = {
|
||||
airspeed: props.globals.getNode("/velocities/airspeed-kt"),
|
||||
groundspeed: props.globals.getNode("/velocities/groundspeed-kt"),
|
||||
mach: props.globals.getNode("/velocities/mach"),
|
||||
};
|
||||
|
||||
setprop("/systems/acconfig/property-tree-setup-loaded", 1);
|
||||
|
|
|
@ -17,15 +17,6 @@ var egt_lightdn_time = 10;
|
|||
var shutdown_time = 20;
|
||||
var egt_shutdown_time = 20;
|
||||
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "B");
|
||||
|
||||
var eng_init = func {
|
||||
setprop("/controls/engines/engine[0]/man-start", 0);
|
||||
setprop("/controls/engines/engine[1]/man-start", 0);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
|
||||
if (getprop("/options/eng") == "IAE") {
|
||||
if (pts.Options.eng.getValue() == "IAE") {
|
||||
io.include("engines-iae.nas");
|
||||
} else {
|
||||
io.include("engines-cfm.nas");
|
||||
|
@ -50,87 +50,84 @@ var doTOGAThrust = func {
|
|||
|
||||
# Reverse Thrust System
|
||||
var toggleFastRevThrust = func {
|
||||
var state1 = getprop("/systems/thrust/state1");
|
||||
var state2 = getprop("/systems/thrust/state2");
|
||||
if (state1 == "IDLE" and state2 == "IDLE" and getprop("/controls/engines/engine[0]/reverser") == "0" and getprop("/controls/engines/engine[1]/reverser") == "0" and getprop("/gear/gear[1]/wow") == 1 and getprop("/gear/gear[2]/wow") == 1) {
|
||||
if (getprop("/sim/input/selected/engine[0]") == 1) {
|
||||
if (pts.Systems.Thrust.state[0].getValue() == "IDLE" and pts.Systems.Thrust.state[1].getValue() == "IDLE" and pts.Controls.Engines.Engine.reverser[0].getValue() == 0 and pts.Controls.Engines.Engine.reverser[1].getValue() == 0 and pts.Gear.wow[1].getValue() == 1 and pts.Gear.wow[2].getValue() == 1) {
|
||||
if (pts.Sim.Input.Selected.engine[0].getBoolValue()) {
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 1, 1.4);
|
||||
setprop("/controls/engines/engine[0]/reverser", 1);
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0.65);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
|
||||
pts.Controls.Engines.Engine.reverser[0].setValue(1);
|
||||
pts.Controls.Engines.Engine.throttleRev[0].setValue(0.65);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[0].setValue(3.14);
|
||||
}
|
||||
if (getprop("/sim/input/selected/engine[1]") == 1) {
|
||||
if (pts.Sim.Input.Selected.engine[1].getBoolValue()) {
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 1, 1.4);
|
||||
setprop("/controls/engines/engine[1]/reverser", 1);
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0.65);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 3.14);
|
||||
pts.Controls.Engines.Engine.reverser[1].setValue(1);
|
||||
pts.Controls.Engines.Engine.throttleRev[1].setValue(0.65);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[1].setValue(3.14);
|
||||
}
|
||||
} else if ((getprop("/controls/engines/engine[0]/reverser") == "1") or (getprop("/controls/engines/engine[1]/reverser") == "1")) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0);
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0);
|
||||
} else if (pts.Controls.Engines.Engine.reverser[0].getValue() == 1 or pts.Controls.Engines.Engine.reverser[1].getValue() == 1) {
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 0, 1.0);
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 0, 1.0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 0);
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
pts.Controls.Engines.Engine.throttleRev[0].setValue(0);
|
||||
pts.Controls.Engines.Engine.throttleRev[1].setValue(0);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[0].setValue(0);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[1].setValue(0);
|
||||
pts.Controls.Engines.Engine.reverser[0].setValue(0);
|
||||
pts.Controls.Engines.Engine.reverser[1].setValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
var doRevThrust = func {
|
||||
if (getprop("/gear/gear[1]/wow") != 1 and getprop("/gear/gear[2]/wow") != 1) {
|
||||
if (pts.Gear.wow[1].getValue() != 1 and pts.Gear.wow[2].getValue() != 1) {
|
||||
# Can't select reverse if not on the ground
|
||||
return;
|
||||
}
|
||||
if (getprop("/sim/input/selected/engine[0]") == 1 and getprop("/controls/engines/engine[0]/reverser") == "1") {
|
||||
var pos = getprop("/controls/engines/engine[0]/throttle-rev");
|
||||
if (pts.Sim.Input.Selected.engine[0].getBoolValue() and pts.Controls.Engines.Engine.reverser[0].getValue() == 1) {
|
||||
var pos = pts.Controls.Engines.Engine.throttleRev[0].getValue();
|
||||
if (pos < 0.649) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", pos + 0.15);
|
||||
pts.Controls.Engines.Engine.throttleRev[0].setValue(pos + 0.15);
|
||||
}
|
||||
}
|
||||
if (getprop("/sim/input/selected/engine[1]") == 1 and getprop("/controls/engines/engine[1]/reverser") == "1") {
|
||||
var pos = getprop("/controls/engines/engine[1]/throttle-rev");
|
||||
if (pts.Sim.Input.Selected.engine[1].getBoolValue() and pts.Controls.Engines.Engine.reverser[1].getValue() == 1) {
|
||||
var pos = pts.Controls.Engines.Engine.throttleRev[1].getValue();
|
||||
if (pos < 0.649) {
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", pos + 0.15);
|
||||
pts.Controls.Engines.Engine.throttleRev[1].setValue(pos + 0.15);
|
||||
}
|
||||
}
|
||||
var state1 = getprop("/systems/thrust/state1");
|
||||
var state2 = getprop("/systems/thrust/state2");
|
||||
if (getprop("/sim/input/selected/engine[0]") == 1 and state1 == "IDLE" and getprop("/controls/engines/engine[0]/reverser") == "0") {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0.05);
|
||||
|
||||
if (pts.Sim.Input.Selected.engine[0].getBoolValue() and pts.Systems.Thrust.state[0].getValue() == "IDLE" and pts.Controls.Engines.Engine.reverser[0].getValue() == 0) {
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 1, 1.4);
|
||||
setprop("/controls/engines/engine[0]/reverser", 1);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 3.14);
|
||||
pts.Controls.Engines.Engine.throttleRev[0].setValue(0.05);
|
||||
pts.Controls.Engines.Engine.reverser[0].setValue(1);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[0].setValue(3.14);
|
||||
}
|
||||
if (getprop("/sim/input/selected/engine[1]") == 1 and state2 == "IDLE" and getprop("/controls/engines/engine[1]/reverser") == "0") {
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0.05);
|
||||
if (pts.Sim.Input.Selected.engine[1].getBoolValue() and pts.Systems.Thrust.state[1].getValue() == "IDLE" and pts.Controls.Engines.Engine.reverser[1].getValue() == 0) {
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 1, 1.4);
|
||||
setprop("/controls/engines/engine[1]/reverser", 1);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 3.14);
|
||||
pts.Controls.Engines.Engine.throttleRev[1].setValue(0.05);
|
||||
pts.Controls.Engines.Engine.reverser[1].setValue(1);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[1].setValue(3.14);
|
||||
}
|
||||
}
|
||||
|
||||
var unRevThrust = func {
|
||||
if (getprop("/sim/input/selected/engine[0]") == 1 and getprop("/controls/engines/engine[0]/reverser") == "1") {
|
||||
var pos = getprop("/controls/engines/engine[0]/throttle-rev");
|
||||
if (pts.Sim.Input.Selected.engine[0].getBoolValue() and pts.Controls.Engines.Engine.reverser[0].getValue() == 1) {
|
||||
var pos = pts.Controls.Engines.Engine.throttleRev[0].getValue();
|
||||
if (pos > 0.051) {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", pos - 0.15);
|
||||
pts.Controls.Engines.Engine.throttleRev[0].setValue(pos - 0.15);
|
||||
} else {
|
||||
setprop("/controls/engines/engine[0]/throttle-rev", 0);
|
||||
interpolate("/engines/engine[0]/reverser-pos-norm", 0, 1.0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[0]/reverser-angle-rad", 0);
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
pts.Controls.Engines.Engine.throttleRev[0].setValue(0);
|
||||
pts.Controls.Engines.Engine.reverser[0].setValue(0);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[0].setValue(0);
|
||||
}
|
||||
}
|
||||
if (getprop("/sim/input/selected/engine[1]") == 1 and getprop("/controls/engines/engine[1]/reverser") == "1") {
|
||||
var pos = getprop("/controls/engines/engine[1]/throttle-rev");
|
||||
if (pts.Sim.Input.Selected.engine[1].getBoolValue() and pts.Controls.Engines.Engine.reverser[1].getValue() == 1) {
|
||||
var pos = pts.Controls.Engines.Engine.throttleRev[1].getValue();
|
||||
if (pos > 0.051) {
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", pos - 0.15);
|
||||
pts.Controls.Engines.Engine.throttleRev[1].setValue(pos - 0.15);
|
||||
} else {
|
||||
setprop("/controls/engines/engine[1]/throttle-rev", 0);
|
||||
interpolate("/engines/engine[1]/reverser-pos-norm", 0, 1.0);
|
||||
setprop("/fdm/jsbsim/propulsion/engine[1]/reverser-angle-rad", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
pts.Controls.Engines.Engine.throttleRev[1].setValue(0);
|
||||
pts.Controls.Engines.Engine.reverser[1].setValue(0);
|
||||
pts.Fdm.JSBsim.Propulsion.Engine.reverserAngle[1].setValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,15 +17,6 @@ var egt_lightdn_time = 10;
|
|||
var shutdown_time = 20;
|
||||
var egt_shutdown_time = 20;
|
||||
|
||||
setprop("/controls/engines/engine[0]/reverser", 0);
|
||||
setprop("/controls/engines/engine[1]/reverser", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-a", 0);
|
||||
setprop("/controls/engines/engine[0]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[1]/igniter-b", 0);
|
||||
setprop("/controls/engines/engine[0]/last-igniter", "B");
|
||||
setprop("/controls/engines/engine[1]/last-igniter", "B");
|
||||
|
||||
var eng_init = func {
|
||||
setprop("/controls/engines/engine[0]/man-start", 0);
|
||||
setprop("/controls/engines/engine[1]/man-start", 0);
|
||||
|
|
|
@ -2,139 +2,139 @@
|
|||
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
|
||||
setprop("systems/fadec/n1mode1", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("systems/fadec/n1mode2", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("systems/fadec/eng1/egt", 1);
|
||||
setprop("systems/fadec/eng1/n1", 1);
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
setprop("systems/fadec/eng1/ff", 1);
|
||||
setprop("systems/fadec/eng2/egt", 1);
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
setprop("systems/fadec/power-avail", 0);
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
setprop("systems/fadec/powered-time", -300);
|
||||
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);
|
||||
setprop("/systems/fadec/n1mode1", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("/systems/fadec/n1mode2", 0); # Doesn't do anything, just here for other logic #
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
setprop("/systems/fadec/powered-time", -300);
|
||||
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 FADEC = {
|
||||
init: func() {
|
||||
setprop("systems/fadec/powered-time", 0);
|
||||
setprop("systems/fadec/eng1-master-time", -300);
|
||||
setprop("systems/fadec/eng2-master-time", -300);
|
||||
setprop("/systems/fadec/powered-time", 0);
|
||||
setprop("/systems/fadec/eng1-master-time", -300);
|
||||
setprop("/systems/fadec/eng2-master-time", -300);
|
||||
},
|
||||
loop: func() {
|
||||
var ac1 = getprop("systems/electrical/bus/ac-1");
|
||||
var ac2 = getprop("systems/electrical/bus/ac-2");
|
||||
var acess = getprop("systems/electrical/bus/ac-ess");
|
||||
var state1 = getprop("engines/engine[0]/state");
|
||||
var state2 = getprop("engines/engine[1]/state");
|
||||
var master1 = getprop("controls/engines/engine[0]/cutoff-switch");
|
||||
var master2 = getprop("controls/engines/engine[1]/cutoff-switch");
|
||||
var modeSel = getprop("controls/engines/engine-start-switch");
|
||||
var elapsedSec = getprop("sim/time/elapsed-sec");
|
||||
var ac1 = systems.ELEC.Bus.ac1.getValue();
|
||||
var ac2 = systems.ELEC.Bus.ac2.getValue();
|
||||
var acess = systems.ELEC.Bus.acEss.getValue();
|
||||
var state1 = pts.Engines.Engine.state[0].getValue();
|
||||
var state2 = pts.Engines.Engine.state[1].getValue();
|
||||
var master1 = pts.Controls.Engines.Engine.cutoffSw[0].getValue();
|
||||
var master2 = pts.Controls.Engines.Engine.cutoffSw[1].getValue();
|
||||
var modeSel = pts.Controls.Engines.startSw.getValue();
|
||||
var elapsedSec = pts.Sim.Time.elapsedSec.getValue();
|
||||
|
||||
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);
|
||||
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);
|
||||
if (getprop("/systems/fadec/power-avail") != 0) {
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var powerAvail = getprop("systems/fadec/power-avail");
|
||||
var powerAvail = getprop("/systems/fadec/power-avail");
|
||||
|
||||
if (getprop("systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/powerup", 1);
|
||||
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/powerup", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/powerup", 0);
|
||||
setprop("/systems/fadec/powerup", 0);
|
||||
}
|
||||
|
||||
if (master1 == 1) {
|
||||
if (getprop("systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng1-master-count", 1);
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng1-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("systems/fadec/eng1-master-count", 0);
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng1-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng1-off-power", 1);
|
||||
if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng1-off-power", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng1-off-power", 0);
|
||||
setprop("/systems/fadec/eng1-off-power", 0);
|
||||
}
|
||||
|
||||
if (master2 == 1) {
|
||||
if (getprop("systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng2-master-count", 1);
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng2-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("systems/fadec/eng2-master-count", 0);
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng2-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng2-off-power", 1);
|
||||
if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng2-off-power", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng2-off-power", 0);
|
||||
setprop("/systems/fadec/eng2-off-power", 0);
|
||||
}
|
||||
|
||||
if (state1 == 3) {
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
}
|
||||
|
||||
if (state2 == 3) {
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
}
|
||||
|
||||
var powered1 = getprop("systems/fadec/powered1");
|
||||
var powered2 = getprop("systems/fadec/powered2");
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
setprop("/systems/fadec/eng2/n1", 0);
|
||||
setprop("/systems/fadec/eng2/egt", 0);
|
||||
setprop("/systems/fadec/eng2/n2", 0);
|
||||
setprop("/systems/fadec/eng2/ff", 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -2,191 +2,191 @@
|
|||
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
|
||||
setprop("controls/fadec/n1mode1", 0);
|
||||
setprop("controls/fadec/n1mode2", 0);
|
||||
setprop("systems/fadec/n1mode1", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("systems/fadec/n1mode2", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("systems/fadec/eng1/epr", 1);
|
||||
setprop("systems/fadec/eng1/egt", 1);
|
||||
setprop("systems/fadec/eng1/n1", 1);
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
setprop("systems/fadec/eng1/ff", 1);
|
||||
setprop("systems/fadec/eng2/epr", 1);
|
||||
setprop("systems/fadec/eng2/egt", 1);
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
setprop("systems/fadec/power-avail", 0);
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
setprop("systems/fadec/powered-time", -300);
|
||||
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);
|
||||
setprop("/controls/fadec/n1mode1", 0);
|
||||
setprop("/controls/fadec/n1mode2", 0);
|
||||
setprop("/systems/fadec/n1mode1", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("/systems/fadec/n1mode2", 0); # 0 == EPR, 1 == N1 Rated, 2 == N1 Unrated #
|
||||
setprop("/systems/fadec/eng1/epr", 1);
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
setprop("/systems/fadec/eng2/epr", 1);
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
setprop("/systems/fadec/powered-time", -300);
|
||||
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 FADEC = {
|
||||
init: func() {
|
||||
setprop("systems/fadec/powered-time", 0);
|
||||
setprop("systems/fadec/eng1-master-time", -300);
|
||||
setprop("systems/fadec/eng2-master-time", -300);
|
||||
setprop("/systems/fadec/powered-time", 0);
|
||||
setprop("/systems/fadec/eng1-master-time", -300);
|
||||
setprop("/systems/fadec/eng2-master-time", -300);
|
||||
},
|
||||
loop: func() {
|
||||
var ac1 = getprop("systems/electrical/bus/ac-1");
|
||||
var ac2 = getprop("systems/electrical/bus/ac-2");
|
||||
var acess = getprop("systems/electrical/bus/ac-ess");
|
||||
var state1 = getprop("engines/engine[0]/state");
|
||||
var state2 = getprop("engines/engine[1]/state");
|
||||
var master1 = getprop("controls/engines/engine[0]/cutoff-switch");
|
||||
var master2 = getprop("controls/engines/engine[1]/cutoff-switch");
|
||||
var modeSel = getprop("controls/engines/engine-start-switch");
|
||||
var N1Mode1_sw = getprop("controls/fadec/n1mode1");
|
||||
var N1Mode2_sw = getprop("controls/fadec/n1mode2");
|
||||
var elapsedSec = getprop("sim/time/elapsed-sec");
|
||||
var ac1 = systems.ELEC.Bus.ac1.getValue();
|
||||
var ac2 = systems.ELEC.Bus.ac2.getValue();
|
||||
var acess = systems.ELEC.Bus.acEss.getValue();
|
||||
var state1 = pts.Engines.Engine.state[0].getValue();
|
||||
var state2 = pts.Engines.Engine.state[1].getValue();
|
||||
var master1 = pts.Controls.Engines.Engine.cutoffSw[0].getValue();
|
||||
var master2 = pts.Controls.Engines.Engine.cutoffSw[1].getValue();
|
||||
var modeSel = pts.Controls.Engines.startSw.getValue();
|
||||
var elapsedSec = pts.Sim.Time.elapsedSec.getValue();
|
||||
var N1Mode1_sw = getprop("/controls/fadec/n1mode1");
|
||||
var N1Mode2_sw = getprop("/controls/fadec/n1mode2");
|
||||
|
||||
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);
|
||||
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);
|
||||
if (getprop("/systems/fadec/power-avail") != 0) {
|
||||
setprop("/systems/fadec/power-avail", 0);
|
||||
}
|
||||
}
|
||||
|
||||
var powerAvail = getprop("systems/fadec/power-avail");
|
||||
var powerAvail = getprop("/systems/fadec/power-avail");
|
||||
|
||||
if (getprop("systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/powerup", 1);
|
||||
if (getprop("/systems/fadec/powered-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/powerup", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/powerup", 0);
|
||||
setprop("/systems/fadec/powerup", 0);
|
||||
}
|
||||
|
||||
if (master1 == 1) {
|
||||
if (getprop("systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng1-master-count", 1);
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng1-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng1-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("systems/fadec/eng1-master-count", 0);
|
||||
if (getprop("/systems/fadec/eng1-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng1-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng1-off-power", 1);
|
||||
if (getprop("/systems/fadec/eng1-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng1-off-power", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng1-off-power", 0);
|
||||
setprop("/systems/fadec/eng1-off-power", 0);
|
||||
}
|
||||
|
||||
if (master2 == 1) {
|
||||
if (getprop("systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("systems/fadec/eng2-master-count", 1);
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 1) {
|
||||
setprop("/systems/fadec/eng2-master-time", elapsedSec);
|
||||
setprop("/systems/fadec/eng2-master-count", 1);
|
||||
}
|
||||
} else {
|
||||
if (getprop("systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("systems/fadec/eng2-master-count", 0);
|
||||
if (getprop("/systems/fadec/eng2-master-count") != 0) {
|
||||
setprop("/systems/fadec/eng2-master-count", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (getprop("systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("systems/fadec/eng2-off-power", 1);
|
||||
if (getprop("/systems/fadec/eng2-master-time") + 300 >= elapsedSec) {
|
||||
setprop("/systems/fadec/eng2-off-power", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng2-off-power", 0);
|
||||
setprop("/systems/fadec/eng2-off-power", 0);
|
||||
}
|
||||
|
||||
if (state1 == 3) {
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("systems/fadec/powered1", 1);
|
||||
setprop("/systems/fadec/powered1", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/powered1", 0);
|
||||
setprop("/systems/fadec/powered1", 0);
|
||||
}
|
||||
|
||||
if (state2 == 3) {
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
} else if (powerAvail and modeSel == 2) {
|
||||
setprop("systems/fadec/powered2", 1);
|
||||
setprop("/systems/fadec/powered2", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/powered2", 0);
|
||||
setprop("/systems/fadec/powered2", 0);
|
||||
}
|
||||
|
||||
if (N1Mode1_sw == 1) {
|
||||
setprop("systems/fadec/n1mode1", 1);
|
||||
setprop("/systems/fadec/n1mode1", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/n1mode1", 0);
|
||||
setprop("/systems/fadec/n1mode1", 0);
|
||||
}
|
||||
|
||||
if (N1Mode2_sw == 1) {
|
||||
setprop("systems/fadec/n1mode2", 1);
|
||||
setprop("/systems/fadec/n1mode2", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/n1mode2", 0);
|
||||
setprop("/systems/fadec/n1mode2", 0);
|
||||
}
|
||||
|
||||
var powered1 = getprop("systems/fadec/powered1");
|
||||
var powered2 = getprop("systems/fadec/powered2");
|
||||
var N1Mode1 = getprop("systems/fadec/n1mode1");
|
||||
var N1Mode2 = getprop("systems/fadec/n1mode2");
|
||||
var powered1 = getprop("/systems/fadec/powered1");
|
||||
var powered2 = getprop("/systems/fadec/powered2");
|
||||
var N1Mode1 = getprop("/systems/fadec/n1mode1");
|
||||
var N1Mode2 = getprop("/systems/fadec/n1mode2");
|
||||
var N11 = getprop("engines/engine[0]/n1-actual");
|
||||
var N12 = getprop("engines/engine[1]/n1-actual");
|
||||
var N21 = getprop("engines/engine[0]/n2-actual");
|
||||
var N22 = getprop("engines/engine[1]/n2-actual");
|
||||
|
||||
if ((powered1 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
|
||||
setprop("systems/fadec/eng1/epr", 1);
|
||||
if ((powered1 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) and N1Mode1 == 0) {
|
||||
setprop("/systems/fadec/eng1/epr", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng1/epr", 0);
|
||||
setprop("/systems/fadec/eng1/epr", 0);
|
||||
}
|
||||
|
||||
if ((powered2 or getprop("systems/fadec/powerup") or getprop("systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
|
||||
setprop("systems/fadec/eng2/epr", 1);
|
||||
if ((powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) and N1Mode2 == 0) {
|
||||
setprop("/systems/fadec/eng2/epr", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng2/epr", 0);
|
||||
setprop("/systems/fadec/eng2/epr", 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 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng1-off-power")) {
|
||||
setprop("/systems/fadec/eng1/egt", 1);
|
||||
setprop("/systems/fadec/eng1/ff", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng1/egt", 0);
|
||||
setprop("systems/fadec/eng1/ff", 0);
|
||||
setprop("/systems/fadec/eng1/egt", 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/egt", 1);
|
||||
setprop("systems/fadec/eng2/ff", 1);
|
||||
if (powered2 or getprop("/systems/fadec/powerup") or getprop("/systems/fadec/eng2-off-power")) {
|
||||
setprop("/systems/fadec/eng2/egt", 1);
|
||||
setprop("/systems/fadec/eng2/ff", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng2/egt", 0);
|
||||
setprop("systems/fadec/eng2/ff", 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);
|
||||
setprop("/systems/fadec/eng1/n1", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng1/n1", 0);
|
||||
setprop("/systems/fadec/eng1/n1", 0);
|
||||
}
|
||||
|
||||
if (powered2 and N12 >= 3.5) {
|
||||
setprop("systems/fadec/eng2/n1", 1);
|
||||
setprop("/systems/fadec/eng2/n1", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng2/n1", 0);
|
||||
setprop("/systems/fadec/eng2/n1", 0);
|
||||
}
|
||||
|
||||
if (powered1 and N21 >= 3.5) {
|
||||
setprop("systems/fadec/eng1/n2", 1);
|
||||
setprop("/systems/fadec/eng1/n2", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng1/n2", 0);
|
||||
setprop("/systems/fadec/eng1/n2", 0);
|
||||
}
|
||||
|
||||
if (powered2 and N22 >= 3.5) {
|
||||
setprop("systems/fadec/eng2/n2", 1);
|
||||
setprop("/systems/fadec/eng2/n2", 1);
|
||||
} else {
|
||||
setprop("systems/fadec/eng2/n2", 0);
|
||||
setprop("/systems/fadec/eng2/n2", 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -33,8 +33,20 @@
|
|||
#
|
||||
# Added brakes temp calculations and adapted for A320-family
|
||||
# 2020, Andrea Vezzali
|
||||
#
|
||||
# Updated Nasal to project standards
|
||||
# 2020, Jonathan Redpath
|
||||
##########################################################################
|
||||
|
||||
var LThermalEnergy = 0;
|
||||
var RThermalEnergy = 0;
|
||||
var dt = 0;
|
||||
var LBrakeLevel = 0;
|
||||
var RBrakeLevel = 0;
|
||||
var tatdegc = 0;
|
||||
var L_thrust = 0;
|
||||
var R_thrust = 0;
|
||||
var airspeed = 0;
|
||||
|
||||
var BrakeSystem =
|
||||
{
|
||||
new : func()
|
||||
|
@ -56,9 +68,17 @@ var BrakeSystem =
|
|||
m.LSmokeToggle = 0;
|
||||
m.RSmokeActive = 0;
|
||||
m.RSmokeToggle = 0;
|
||||
# m.LnCoolFactor = math.ln(1-m.CoolingFactor);
|
||||
|
||||
m.reset();
|
||||
m.thermalEnergy = [0.0, 0.0];
|
||||
m.brakeFans = props.globals.getNode("/controls/gear/brake-fans");
|
||||
m.fireServices = props.globals.getNode("/sim/animation/fire-services");
|
||||
m.gearSmoke = [props.globals.getNode("/gear/gear[1]/Lbrake-smoke"), props.globals.getNode("/gear/gear[2]/Rbrake-smoke")];
|
||||
m.lBrakeTemp = [props.globals.getNode("/gear/gear[1]/L1brake-temp-degc"),props.globals.getNode("/gear/gear[1]/L2brake-temp-degc")];
|
||||
m.rBrakeTemp = [props.globals.getNode("/gear/gear[2]/R3brake-temp-degc"),props.globals.getNode("/gear/gear[2]/R4brake-temp-degc")];
|
||||
m.L1error = 0;
|
||||
m.L2error = 0;
|
||||
m.R3error = 0;
|
||||
m.R4error = 0;
|
||||
m.counter = 0;
|
||||
|
||||
return m;
|
||||
},
|
||||
|
@ -66,73 +86,68 @@ var BrakeSystem =
|
|||
reset : func()
|
||||
{
|
||||
# Initial thermal energy
|
||||
setprop("gear/gear[1]/Lbrake-thermal-energy",0.0);
|
||||
setprop("gear/gear[2]/Rbrake-thermal-energy",0.0);
|
||||
me.thermalEnergy[0] = 0.0;
|
||||
me.thermalEnergy[1] = 0.0;
|
||||
|
||||
setprop("/controls/gear/brake-fans",0);
|
||||
setprop("gear/gear[1]/Lbrake-smoke",0);
|
||||
setprop("gear/gear[2]/Rbrake-smoke",0);
|
||||
setprop("gear/gear[1]/L-Thrust",0);
|
||||
setprop("gear/gear[2]/R-Thrust",0);
|
||||
me.brakeFans.setValue(0);
|
||||
me.gearSmoke[0].setValue(0);
|
||||
me.gearSmoke[1].setValue(0);
|
||||
me.fireServices.setValue(0);
|
||||
|
||||
#Introducing a random error on temp sensors (max 5°C)
|
||||
setprop("gear/gear[1]/L1error-temp-degc", math.round(rand()*(5)));
|
||||
setprop("gear/gear[1]/L2error-temp-degc", math.round(rand()*(5)));
|
||||
setprop("gear/gear[2]/R3error-temp-degc", math.round(rand()*(5)));
|
||||
setprop("gear/gear[2]/R4error-temp-degc", math.round(rand()*(5)));
|
||||
me.L1error = math.round(rand()*(5));
|
||||
me.L2error = math.round(rand()*(5));
|
||||
me.R3error = math.round(rand()*(5));
|
||||
me.R4error = math.round(rand()*(5));
|
||||
|
||||
#var atemp = getprop("environment/temperature-degc") or 0;
|
||||
#var vmach = getprop("velocities/mach") or 0;
|
||||
var tatdegc = getprop("/systems/navigation/probes/tat-1/compute-tat") or 0;
|
||||
var atemp = getprop("environment/temperature-degc") or 0;
|
||||
var vmach = getprop("velocities/mach") or 0;
|
||||
var tatdegc = getprop("/systems/navigation/probes/tat-1/compute-tat");
|
||||
var tatdegc = pts.Fdm.JSBsim.Propulsion.tatC.getValue() or 0;
|
||||
|
||||
setprop("gear/gear[1]/L1brake-temp-degc",tatdegc+getprop("gear/gear[1]/L1error-temp-degc"));
|
||||
setprop("gear/gear[1]/L2brake-temp-degc",tatdegc+getprop("gear/gear[1]/L2error-temp-degc"));
|
||||
setprop("gear/gear[2]/R3brake-temp-degc",tatdegc+getprop("gear/gear[2]/R3error-temp-degc"));
|
||||
setprop("gear/gear[2]/R4brake-temp-degc",tatdegc+getprop("gear/gear[2]/R4error-temp-degc"));
|
||||
me.lBrakeTemp[0].setValue(tatdegc+me.L1error);
|
||||
me.lBrakeTemp[1].setValue(tatdegc+me.L2error);
|
||||
me.rBrakeTemp[0].setValue(tatdegc+me.R3error);
|
||||
me.rBrakeTemp[1].setValue(tatdegc+me.R4error);
|
||||
|
||||
setprop("/sim/animation/fire-services",0);
|
||||
me.LastSimTime = 0.0;
|
||||
},
|
||||
|
||||
|
||||
# update brake energy
|
||||
update : func()
|
||||
{
|
||||
var CurrentTime = getprop("/sim/time/elapsed-sec");
|
||||
var dt = CurrentTime - me.LastSimTime;
|
||||
var LThermalEnergy = getprop("gear/gear[1]/Lbrake-thermal-energy");
|
||||
var RThermalEnergy = getprop("gear/gear[2]/Rbrake-thermal-energy");
|
||||
var LBrakeLevel = getprop("fdm/jsbsim/fcs/left-brake-cmd-norm");
|
||||
var RBrakeLevel = getprop("fdm/jsbsim/fcs/right-brake-cmd-norm");
|
||||
#var atemp = getprop("environment/temperature-degc") or 0;
|
||||
#var vmach = getprop("velocities/mach") or 0;
|
||||
#var tatdegc = atemp * (1 + (0.2 * math.pow(vmach, 2)));
|
||||
var tatdegc = getprop("/systems/navigation/probes/tat-1/compute-tat") or 0;
|
||||
var L_thrust_lb = getprop("engines/engine[0]/thrust_lb");
|
||||
var R_thrust_lb = getprop("engines/engine[1]/thrust_lb");
|
||||
if (me.counter == 0) {
|
||||
me.counter = 1;
|
||||
} else {
|
||||
me.counter = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
LThermalEnergy = me.thermalEnergy[0];
|
||||
RThermalEnergy = me.thermalEnergy[1];
|
||||
me.CurrentTime = pts.Sim.Time.elapsedSec.getValue();
|
||||
dt = me.CurrentTime - me.LastSimTime;
|
||||
LBrakeLevel = pts.Fdm.JSBsim.Fcs.brake[0].getValue();
|
||||
RBrakeLevel = pts.Fdm.JSBsim.Fcs.brake[1].getValue();
|
||||
tatdegc = pts.Fdm.JSBsim.Propulsion.tatC.getValue() or 0;
|
||||
|
||||
if (getprop("/sim/freeze/replay-state")==0 and dt<1.0) {
|
||||
var OnGround = getprop("gear/gear[1]/wow");
|
||||
if (pts.Sim.replayState.getValue() == 0 and dt < 1.0) {
|
||||
#cooling effect: adjust cooling factor by a value proportional to the environment temp (m.CoolingFactor + environment temp-degc * 0.00001)
|
||||
var LCoolingRatio = me.CoolingFactor+(tatdegc*0.000001);
|
||||
var RCoolingRatio = me.CoolingFactor+(tatdegc*0.000001);
|
||||
if (getprop("/controls/gear/brake-fans")) {
|
||||
if (me.brakeFans.getValue()) {
|
||||
#increase CoolingRatio if Brake Fans are active
|
||||
LCoolingRatio = LCoolingRatio * 3;
|
||||
RCoolingRatio = RCoolingRatio * 3;
|
||||
};
|
||||
if (getprop("gear/gear[1]/position-norm")) {
|
||||
airspeed = pts.Velocities.airspeed.getValue();
|
||||
if (pts.Gear.position[1].getValue()) {
|
||||
#increase CoolingRatio if gear down according to airspeed
|
||||
LCoolingRatio = LCoolingRatio * getprop("velocities/airspeed-kt");
|
||||
LCoolingRatio = LCoolingRatio * airspeed;
|
||||
} else {
|
||||
#Reduced CoolingRatio if gear up
|
||||
LCoolingRatio = LCoolingRatio * 0.1;
|
||||
};
|
||||
if (getprop("gear/gear[2]/position-norm")) {
|
||||
if (pts.Gear.position[2].getValue()) {
|
||||
#increase CoolingRatio if gear down according to airspeed
|
||||
RCoolingRatio = RCoolingRatio * getprop("velocities/airspeed-kt");
|
||||
RCoolingRatio = RCoolingRatio * airspeed;
|
||||
} else {
|
||||
#Reduced CoolingRatio if gear up
|
||||
RCoolingRatio = RCoolingRatio * 0.1;
|
||||
|
@ -149,34 +164,22 @@ var BrakeSystem =
|
|||
var LnCoolFactor = math.ln(1-LCoolingRatio);
|
||||
var RnCoolFactor = math.ln(1-RCoolingRatio);
|
||||
|
||||
L_thrust_lb = math.abs(getprop("engines/engine[0]/thrust_lb"));
|
||||
if (L_thrust_lb < 1) {
|
||||
L_thrust_lb = 1
|
||||
};
|
||||
#Disabling thrust computation on Brakes temperature
|
||||
#L_Thrust = math.pow((math.log10(L_thrust_lb)),10)*0.0000000002;
|
||||
# disabled thrust effect
|
||||
L_Thrust = 0;
|
||||
|
||||
R_thrust_lb = math.abs(getprop("engines/engine[1]/thrust_lb"));
|
||||
if (R_thrust_lb < 1) {
|
||||
R_thrust_lb = 1
|
||||
};
|
||||
#Disabling thrust computation on Brakes temperature
|
||||
#R_Thrust = math.pow((math.log10(R_thrust_lb)),10)*0.0000000002;
|
||||
R_Thrust = 0;
|
||||
|
||||
if (OnGround) {
|
||||
var V1 = getprop("velocities/groundspeed-kt");
|
||||
var Mass = getprop("fdm/jsbsim/inertia/weight-lbs")*(me.ScalingDivisor);
|
||||
if (pts.Gear.wow[1].getValue()) {
|
||||
var V1 = pts.Velocities.groundspeed.getValue();
|
||||
var Mass = pts.Fdm.JSBsim.Inertia.weightLbs.getValue() * me.ScalingDivisor;
|
||||
|
||||
# absorb some kinetic energy:
|
||||
# dE= 1/2 * m * V1^2 - 1/2 * m * V2^2)
|
||||
var V2_L = V1 - me.BrakeDecel * dt * LBrakeLevel;
|
||||
var V2_R = V1 - me.BrakeDecel * dt * RBrakeLevel;
|
||||
|
||||
LThermalEnergy += (Mass * getprop("gear/gear[1]/compression-norm") * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2);
|
||||
if (getprop("/services/chocks/enable")) {
|
||||
if (!getprop("/controls/gear/brake-parking")) {
|
||||
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.Controls.Gear.parkingBrake.getValue()) {
|
||||
# cooling effect: reduce thermal energy by (LnCoolFactor) * dt
|
||||
LThermalEnergy = LThermalEnergy * math.exp(LnCoolFactor * dt);
|
||||
} else {
|
||||
|
@ -185,7 +188,7 @@ var BrakeSystem =
|
|||
LThermalEnergy = (LThermalEnergy * math.exp(LnCoolFactor * dt)) + (L_Thrust * dt);
|
||||
};
|
||||
} else {
|
||||
if (!getprop("/controls/gear/brake-parking")) {
|
||||
if (!pts.Controls.Gear.parkingBrake.getValue()) {
|
||||
if (LBrakeLevel>0) {
|
||||
if (V2_L>0) {
|
||||
#LThermalEnergy += (Mass * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2) + L_thrust;
|
||||
|
@ -207,9 +210,9 @@ var BrakeSystem =
|
|||
};
|
||||
};
|
||||
|
||||
RThermalEnergy += (Mass * getprop("gear/gear[2]/compression-norm") * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2);
|
||||
if (getprop("/services/chocks/enable")) {
|
||||
if (!getprop("/controls/gear/brake-parking")) {
|
||||
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.Controls.Gear.parkingBrake.getValue()) {
|
||||
# cooling effect: reduce thermal energy by (RnCoolFactor) * dt
|
||||
RThermalEnergy = RThermalEnergy * math.exp(RnCoolFactor * dt);
|
||||
} else {
|
||||
|
@ -218,7 +221,7 @@ var BrakeSystem =
|
|||
RThermalEnergy = (RThermalEnergy * math.exp(RnCoolFactor * dt)) + (R_Thrust * dt);
|
||||
};
|
||||
} else {
|
||||
if (!getprop("/controls/gear/brake-parking")) {
|
||||
if (!pts.Controls.Gear.parkingBrake.getValue()) {
|
||||
if (RBrakeLevel>0) {
|
||||
if (V2_R>0) {
|
||||
#RThermalEnergy += (Mass * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2) + R_thrust;
|
||||
|
@ -256,67 +259,62 @@ var BrakeSystem =
|
|||
RThermalEnergy = 3
|
||||
};
|
||||
|
||||
setprop("gear/gear[1]/L-Thrust",L_Thrust);
|
||||
setprop("gear/gear[2]/R-Thrust",R_Thrust);
|
||||
setprop("gear/gear[1]/Lbrake-thermal-energy",LThermalEnergy);
|
||||
setprop("gear/gear[2]/Rbrake-thermal-energy",RThermalEnergy);
|
||||
me.thermalEnergy[0] = LThermalEnergy;
|
||||
me.thermalEnergy[1] = RThermalEnergy;
|
||||
|
||||
#Calculating Brakes temperature
|
||||
setprop("gear/gear[1]/L1brake-temp-degc",tatdegc+getprop("gear/gear[1]/L1error-temp-degc")+(LThermalEnergy * (300-tatdegc-getprop("gear/gear[1]/L1error-temp-degc"))));
|
||||
setprop("gear/gear[1]/L2brake-temp-degc",tatdegc+getprop("gear/gear[1]/L2error-temp-degc")+(LThermalEnergy * (300-tatdegc-getprop("gear/gear[1]/L2error-temp-degc"))));
|
||||
setprop("gear/gear[2]/R3brake-temp-degc",tatdegc+getprop("gear/gear[2]/R3error-temp-degc")+(RThermalEnergy * (300-tatdegc-getprop("gear/gear[2]/R3error-temp-degc"))));
|
||||
setprop("gear/gear[2]/R4brake-temp-degc",tatdegc+getprop("gear/gear[2]/R4error-temp-degc")+(RThermalEnergy * (300-tatdegc-getprop("gear/gear[2]/R4error-temp-degc"))));
|
||||
me.lBrakeTemp[0].setValue(tatdegc+me.L1error+(LThermalEnergy * (300-tatdegc-me.L1error)));
|
||||
me.lBrakeTemp[1].setValue(tatdegc+me.L2error+(LThermalEnergy * (300-tatdegc-me.L2error)));
|
||||
me.rBrakeTemp[0].setValue(tatdegc+me.R3error+(RThermalEnergy * (300-tatdegc-me.R3error)));
|
||||
me.rBrakeTemp[1].setValue(tatdegc+me.R4error+(RThermalEnergy * (300-tatdegc-me.R4error)));
|
||||
|
||||
if ((LThermalEnergy>1)and(!me.LSmokeActive)) {
|
||||
if (LThermalEnergy>1 and !me.LSmokeActive) {
|
||||
# start smoke processing
|
||||
me.LSmokeActive = 1;
|
||||
settimer(func { BrakeSys.Lsmoke(); },0);
|
||||
};
|
||||
if ((RThermalEnergy>1)and(!me.RSmokeActive)) {
|
||||
if (RThermalEnergy>1 and !me.RSmokeActive) {
|
||||
# start smoke processing
|
||||
me.RSmokeActive = 1;
|
||||
settimer(func { BrakeSys.Rsmoke(); },0);
|
||||
};
|
||||
};
|
||||
|
||||
me.LastSimTime = CurrentTime;
|
||||
# 5 updates per second are good enough
|
||||
settimer(func { BrakeSys.update(); },0.2);
|
||||
me.LastSimTime = me.CurrentTime;
|
||||
},
|
||||
|
||||
# smoke processing
|
||||
Lsmoke : func()
|
||||
{
|
||||
if ((me.LSmokeActive)and(getprop("gear/gear[1]/Lbrake-thermal-energy")>1)) {
|
||||
if (me.LSmokeActive and me.thermalEnergy[0] > 1) {
|
||||
# make density of smoke effect depend on energy level
|
||||
var LSmokeDelay=0;
|
||||
var LThermalEnergy = getprop("gear/gear[1]/Lbrake-thermal-energy");
|
||||
var LSmokeDelay = 0;
|
||||
var LThermalEnergy = me.thermalEnergy[0];
|
||||
if (LThermalEnergy < 1.5) {
|
||||
LSmokeDelay=(1.5-LThermalEnergy);
|
||||
LSmokeDelay = (1.5 - LThermalEnergy);
|
||||
};
|
||||
|
||||
# No smoke when gear retracted
|
||||
var LSmokeValue = (getprop("gear/gear[1]/position-norm")>0.5);
|
||||
var LSmokeValue = (pts.Gear.position[1].getValue() > 0.5);
|
||||
# toggle smoke to interpolate different densities
|
||||
if (LSmokeDelay>0.05) {
|
||||
if (LSmokeDelay > 0.05) {
|
||||
me.LSmokeToggle = !me.LSmokeToggle;
|
||||
if (!me.LSmokeToggle)
|
||||
LSmokeValue = 0;
|
||||
else
|
||||
LSmokeDelay = 0;
|
||||
};
|
||||
setprop("gear/gear[1]/Lbrake-smoke",LSmokeValue);
|
||||
me.gearSmoke[0].setValue(LSmokeValue);
|
||||
settimer(func { BrakeSys.Lsmoke(); },LSmokeDelay);
|
||||
} else {
|
||||
# stop smoke processing
|
||||
setprop("gear/gear[1]/Lbrake-smoke",0);
|
||||
setprop("/sim/animation/fire-services",0);
|
||||
me.gearSmoke[0].setValue(0);
|
||||
me.LSmokeActive = 0;
|
||||
};
|
||||
if (getprop("gear/gear[1]/Lbrake-thermal-energy") > 1.5) {
|
||||
setprop("/sim/animation/fire-services",1);
|
||||
if (me.thermalEnergy[0] > 1.5) {
|
||||
me.fireServices.setValue(1);
|
||||
} else {
|
||||
setprop("/sim/animation/fire-services",0);
|
||||
me.fireServices.setValue(0);
|
||||
};
|
||||
|
||||
},
|
||||
|
@ -324,35 +322,35 @@ var BrakeSystem =
|
|||
# smoke processing
|
||||
Rsmoke : func()
|
||||
{
|
||||
if ((me.RSmokeActive)and(getprop("gear/gear[2]/Rbrake-thermal-energy")>1)) {
|
||||
if (me.RSmokeActive and me.thermalEnergy[1] > 1) {
|
||||
# make density of smoke effect depend on energy level
|
||||
var RSmokeDelay=0;
|
||||
var RThermalEnergy = getprop("gear/gear[2]/Rbrake-thermal-energy");
|
||||
var RSmokeDelay = 0;
|
||||
var RThermalEnergy = me.thermalEnergy[1];
|
||||
if (RThermalEnergy < 1.5) {
|
||||
RSmokeDelay=(1.5-RThermalEnergy);
|
||||
RSmokeDelay = (1.5 - RThermalEnergy);
|
||||
};
|
||||
|
||||
# No smoke when gear retracted
|
||||
var RSmokeValue = (getprop("gear/gear[2]/position-norm")>0.5);
|
||||
var RSmokeValue = (pts.Gear.position[2].getValue() > 0.5);
|
||||
# toggle smoke to interpolate different densities
|
||||
if (RSmokeDelay>0.05) {
|
||||
if (RSmokeDelay > 0.05) {
|
||||
me.RSmokeToggle = !me.RSmokeToggle;
|
||||
if (!me.RSmokeToggle)
|
||||
RSmokeValue = 0;
|
||||
else
|
||||
RSmokeDelay = 0;
|
||||
};
|
||||
setprop("gear/gear[2]/Rbrake-smoke",RSmokeValue);
|
||||
me.gearSmoke[1].setValue(RSmokeValue);
|
||||
settimer(func { BrakeSys.Rsmoke(); },RSmokeDelay);
|
||||
} else {
|
||||
# stop smoke processing
|
||||
setprop("gear/gear[2]/Rbrake-smoke",0);
|
||||
me.gearSmoke[1].setValue(0);
|
||||
me.RSmokeActive = 0;
|
||||
};
|
||||
if (getprop("gear/gear[2]/Rbrake-thermal-energy") > 1.5) {
|
||||
setprop("/sim/animation/fire-services",1);
|
||||
if (me.thermalEnergy[1] > 1.5) {
|
||||
me.fireServices.setValue(1);
|
||||
} else {
|
||||
setprop("/sim/animation/fire-services",0);
|
||||
me.fireServices.setValue(0);
|
||||
};
|
||||
},
|
||||
};
|
||||
|
@ -437,13 +435,6 @@ controls.applyBrakes = func(v, which = 0) {
|
|||
}
|
||||
}
|
||||
}
|
||||
setlistener("/sim/signals/fdm-initialized",
|
||||
# executed on _every_ FDM reset (but not installing new listeners)
|
||||
func(idle) { BrakeSys.reset(); },
|
||||
0,0);
|
||||
|
||||
settimer(func() { BrakeSys.update(); }, 5);
|
||||
|
||||
|
||||
# Autobrake loop
|
||||
var absChk = maketimer(0.2, func {
|
||||
|
|
|
@ -17,38 +17,38 @@ var ELEC = {
|
|||
_timer2On: 0,
|
||||
EmerElec: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config"),
|
||||
Bus: {
|
||||
acEss: props.globals.getNode("systems/electrical/bus/ac-ess"),
|
||||
acEssShed: props.globals.getNode("systems/electrical/bus/ac-ess-shed"),
|
||||
ac1: props.globals.getNode("systems/electrical/bus/ac-1"),
|
||||
ac2: props.globals.getNode("systems/electrical/bus/ac-2"),
|
||||
dcBat: props.globals.getNode("systems/electrical/bus/dc-bat"),
|
||||
dcEss: props.globals.getNode("systems/electrical/bus/dc-ess"),
|
||||
dcEssShed: props.globals.getNode("systems/electrical/bus/dc-ess-shed"),
|
||||
dc1: props.globals.getNode("systems/electrical/bus/dc-1"),
|
||||
dc2: props.globals.getNode("systems/electrical/bus/dc-2"),
|
||||
dcHot1: props.globals.getNode("systems/electrical/bus/dc-hot-1"),
|
||||
dcHot2: props.globals.getNode("systems/electrical/bus/dc-hot-2"),
|
||||
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
|
||||
acEssShed: props.globals.getNode("/systems/electrical/bus/ac-ess-shed"),
|
||||
ac1: props.globals.getNode("/systems/electrical/bus/ac-1"),
|
||||
ac2: props.globals.getNode("/systems/electrical/bus/ac-2"),
|
||||
dcBat: props.globals.getNode("/systems/electrical/bus/dc-bat"),
|
||||
dcEss: props.globals.getNode("/systems/electrical/bus/dc-ess"),
|
||||
dcEssShed: props.globals.getNode("/systems/electrical/bus/dc-ess-shed"),
|
||||
dc1: props.globals.getNode("/systems/electrical/bus/dc-1"),
|
||||
dc2: props.globals.getNode("/systems/electrical/bus/dc-2"),
|
||||
dcHot1: props.globals.getNode("/systems/electrical/bus/dc-hot-1"),
|
||||
dcHot2: props.globals.getNode("/systems/electrical/bus/dc-hot-2"),
|
||||
},
|
||||
Fail: {
|
||||
acEssBusFault: props.globals.getNode("systems/failures/electrical/ac-ess-bus"),
|
||||
ac1BusFault: props.globals.getNode("systems/failures/electrical/ac-1-bus"),
|
||||
ac2BusFault: props.globals.getNode("systems/failures/electrical/ac-2-bus"),
|
||||
bat1Fault: props.globals.getNode("systems/failures/electrical/bat-1"),
|
||||
bat2Fault: props.globals.getNode("systems/failures/electrical/bat-2"),
|
||||
dcBatBusFault: props.globals.getNode("systems/failures/electrical/dc-bat-bus"),
|
||||
dcEssBusFault: props.globals.getNode("systems/failures/electrical/dc-ess-bus"),
|
||||
dc1BusFault: props.globals.getNode("systems/failures/electrical/dc-1-bus"),
|
||||
dc2BusFault: props.globals.getNode("systems/failures/electrical/dc-2-bus"),
|
||||
emerGenFault: props.globals.getNode("systems/failures/electrical/emer-gen"),
|
||||
essTrFault: props.globals.getNode("systems/failures/electrical/ess-tr"),
|
||||
gen1Fault: props.globals.getNode("systems/failures/electrical/gen-1"),
|
||||
gen2Fault: props.globals.getNode("systems/failures/electrical/gen-2"),
|
||||
genApuFault: props.globals.getNode("systems/failures/electrical/apu"),
|
||||
idg1Fault: props.globals.getNode("systems/failures/electrical/idg-1"), # oil leak or low press
|
||||
idg2Fault: props.globals.getNode("systems/failures/electrical/idg-2"),
|
||||
statInvFault: props.globals.getNode("systems/failures/electrical/stat-inv"),
|
||||
tr1Fault: props.globals.getNode("systems/failures/electrical/tr-1"),
|
||||
tr2Fault: props.globals.getNode("systems/failures/electrical/tr-2"),
|
||||
acEssBusFault: props.globals.getNode("/systems/failures/electrical/ac-ess-bus"),
|
||||
ac1BusFault: props.globals.getNode("/systems/failures/electrical/ac-1-bus"),
|
||||
ac2BusFault: props.globals.getNode("/systems/failures/electrical/ac-2-bus"),
|
||||
bat1Fault: props.globals.getNode("/systems/failures/electrical/bat-1"),
|
||||
bat2Fault: props.globals.getNode("/systems/failures/electrical/bat-2"),
|
||||
dcBatBusFault: props.globals.getNode("/systems/failures/electrical/dc-bat-bus"),
|
||||
dcEssBusFault: props.globals.getNode("/systems/failures/electrical/dc-ess-bus"),
|
||||
dc1BusFault: props.globals.getNode("/systems/failures/electrical/dc-1-bus"),
|
||||
dc2BusFault: props.globals.getNode("/systems/failures/electrical/dc-2-bus"),
|
||||
emerGenFault: props.globals.getNode("/systems/failures/electrical/emer-gen"),
|
||||
essTrFault: props.globals.getNode("/systems/failures/electrical/ess-tr"),
|
||||
gen1Fault: props.globals.getNode("/systems/failures/electrical/gen-1"),
|
||||
gen2Fault: props.globals.getNode("/systems/failures/electrical/gen-2"),
|
||||
genApuFault: props.globals.getNode("/systems/failures/electrical/apu"),
|
||||
idg1Fault: props.globals.getNode("/systems/failures/electrical/idg-1"), # oil leak or low press
|
||||
idg2Fault: props.globals.getNode("/systems/failures/electrical/idg-2"),
|
||||
statInvFault: props.globals.getNode("/systems/failures/electrical/stat-inv"),
|
||||
tr1Fault: props.globals.getNode("/systems/failures/electrical/tr-1"),
|
||||
tr2Fault: props.globals.getNode("/systems/failures/electrical/tr-2"),
|
||||
},
|
||||
Generic: {
|
||||
adf: props.globals.initNode("/systems/electrical/outputs/adf", 0, "DOUBLE"),
|
||||
|
@ -69,39 +69,86 @@ var ELEC = {
|
|||
turnCoordinator: props.globals.initNode("/systems/electrical/outputs/turn-coordinator", 0, "DOUBLE"),
|
||||
},
|
||||
Light: {
|
||||
bat1Fault: props.globals.getNode("/systems/electrical/light/bat-1-fault"),
|
||||
bat2Fault: props.globals.getNode("/systems/electrical/light/bat-2-fault"),
|
||||
},
|
||||
Misc: {
|
||||
},
|
||||
Relay: {
|
||||
essTrContactor: props.globals.getNode("systems/electrical/relay/dc-ess-feed-tr/contact-pos"),
|
||||
acEssFeed1: props.globals.getNode("/systems/electrical/relay/ac-ess-feed-1/contact-pos"),
|
||||
acEssFeed2: props.globals.getNode("/systems/electrical/relay/ac-ess-feed-2/contact-pos"),
|
||||
acEssEmerGenFeed: props.globals.getNode("/systems/electrical/relay/ac-ess-feed-emer-gen/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"),
|
||||
apuGlc: props.globals.getNode("/systems/electrical/relay/apu-glc/contact-pos"),
|
||||
dcEssFeedBat: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-bat/contact-pos"),
|
||||
essTrContactor: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/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"),
|
||||
dcTie2: props.globals.getNode("/systems/electrical/relay/dc-bus-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"),
|
||||
},
|
||||
SomeThing: {
|
||||
emerGenSignal: props.globals.getNode("systems/electrical/some-electric-thingie/emer-gen-operate"),
|
||||
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: {
|
||||
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"),
|
||||
},
|
||||
Bat1: {
|
||||
volt: props.globals.getNode("systems/electrical/sources/bat-1/volt"),
|
||||
amps: props.globals.getNode("systems/electrical/sources/bat-1/amps"),
|
||||
contact: props.globals.getNode("systems/electrical/sources/bat-1/contact"),
|
||||
percent: props.globals.getNode("systems/electrical/sources/bat-1/percent"),
|
||||
time: props.globals.getNode("systems/electrical/sources/bat-1/time"),
|
||||
volt: props.globals.getNode("/systems/electrical/sources/bat-1/volt"),
|
||||
amps: props.globals.getNode("/systems/electrical/sources/bat-1/amps"),
|
||||
contact: props.globals.getNode("/systems/electrical/sources/bat-1/contact"),
|
||||
percent: props.globals.getNode("/systems/electrical/sources/bat-1/percent"),
|
||||
direction: props.globals.getNode("/systems/electrical/sources/bat-1/direction"),
|
||||
time: props.globals.getNode("/systems/electrical/sources/bat-1/time"),
|
||||
},
|
||||
Bat2: {
|
||||
volt: props.globals.getNode("systems/electrical/sources/bat-2/volt"),
|
||||
amps: props.globals.getNode("systems/electrical/sources/bat-2/amps"),
|
||||
contact: props.globals.getNode("systems/electrical/sources/bat-2/contact"),
|
||||
percent: props.globals.getNode("systems/electrical/sources/bat-2/percent"),
|
||||
time: props.globals.getNode("systems/electrical/sources/bat-2/time"),
|
||||
volt: props.globals.getNode("/systems/electrical/sources/bat-2/volt"),
|
||||
amps: props.globals.getNode("/systems/electrical/sources/bat-2/amps"),
|
||||
contact: props.globals.getNode("/systems/electrical/sources/bat-2/contact"),
|
||||
percent: props.globals.getNode("/systems/electrical/sources/bat-2/percent"),
|
||||
direction: props.globals.getNode("/systems/electrical/sources/bat-2/direction"),
|
||||
time: props.globals.getNode("/systems/electrical/sources/bat-2/time"),
|
||||
},
|
||||
EmerGen: {
|
||||
volts: props.globals.getNode("/systems/electrical/sources/emer-gen/output-volt"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/emer-gen/output-hertz"),
|
||||
},
|
||||
Ext: {
|
||||
volts: props.globals.getNode("/systems/electrical/sources/ext/output-volt"),
|
||||
voltsRelay: props.globals.getNode("/systems/electrical/relay/emer-glc/output"),
|
||||
hertz: props.globals.getNode("/systems/electrical/sources/ext/output-hertz"),
|
||||
},
|
||||
tr1: {
|
||||
outputVolt: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output"),
|
||||
outputAmp: props.globals.getNode("/systems/electrical/relay/tr-contactor-1/output-amp"),
|
||||
},
|
||||
tr2: {
|
||||
outputVolt: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output"),
|
||||
outputAmp: props.globals.getNode("/systems/electrical/relay/tr-contactor-2/output-amp"),
|
||||
},
|
||||
trEss: {
|
||||
outputVolt: props.globals.getNode("systems/electrical/sources/tr-ess/output-volt"),
|
||||
outputAmp: props.globals.getNode("systems/electrical/sources/tr-ess/output-amp"),
|
||||
outputVolt: props.globals.getNode("/systems/electrical/sources/tr-ess/output-volt"),
|
||||
outputAmp: props.globals.getNode("/systems/electrical/sources/tr-ess/output-amp"),
|
||||
outputVoltRelay: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output"),
|
||||
outputAmpRelay: props.globals.getNode("/systems/electrical/relay/dc-ess-feed-tr/output-amp"),
|
||||
},
|
||||
IDG1: {
|
||||
gcrRelay: props.globals.getNode("systems/electrical/sources/idg-1/gcr-relay"),
|
||||
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-1/gcr-relay"),
|
||||
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"),
|
||||
},
|
||||
},
|
||||
Switch: {
|
||||
|
@ -162,7 +209,7 @@ var ELEC = {
|
|||
loop: func() {
|
||||
# Autopilot Disconnection routines
|
||||
if (me.Bus.dcEssShed.getValue() < 25) {
|
||||
if (getprop("it-autoflight/output/ap1") == 1 and !me._timer1On) {
|
||||
if (fmgc.Output.ap1.getValue() and !me._timer1On) {
|
||||
me._timer1On = 1;
|
||||
settimer(func() {
|
||||
if (me.Bus.dcEssShed.getValue() < 25) {
|
||||
|
@ -177,7 +224,7 @@ var ELEC = {
|
|||
}
|
||||
|
||||
if (me.Bus.dc2.getValue() < 25) {
|
||||
if (getprop("it-autoflight/output/ap2") == 1 and !me._timer2On) {
|
||||
if (fmgc.Output.ap2.getValue() and !me._timer2On) {
|
||||
me._timer2On = 1;
|
||||
settimer(func() {
|
||||
if (me.Bus.dc2.getValue() < 25) {
|
||||
|
|
|
@ -7,8 +7,8 @@ var FUEL = {
|
|||
offset1: 0,
|
||||
offset2: 0,
|
||||
timeEngStart: 0,
|
||||
cmdCtrOn: props.globals.getNode("systems/fuel/ctr-pump-cmd-on-eng-start"),
|
||||
refuelling: props.globals.getNode("systems/fuel/refuel/refuelling"),
|
||||
cmdCtrOn: props.globals.getNode("/systems/fuel/ctr-pump-cmd-on-eng-start"),
|
||||
refuelling: props.globals.getNode("/systems/fuel/refuel/refuelling"),
|
||||
|
||||
Fail: {
|
||||
pumpLeft1: props.globals.getNode("/systems/failures/fuel/left-tank-pump-1"),
|
||||
|
@ -19,43 +19,43 @@ var FUEL = {
|
|||
pumpRight2: props.globals.getNode("/systems/failures/fuel/right-tank-pump-2"),
|
||||
},
|
||||
Switches: {
|
||||
centerTkMode: props.globals.getNode("controls/fuel/switches/center-mode"),
|
||||
crossfeed: props.globals.getNode("controls/fuel/switches/crossfeed"),
|
||||
pumpLeft1: props.globals.getNode("controls/fuel/switches/pump-left-1"),
|
||||
pumpLeft2: props.globals.getNode("controls/fuel/switches/pump-left-2"),
|
||||
pumpCenter1: props.globals.getNode("controls/fuel/switches/pump-center-1"),
|
||||
pumpCenter2: props.globals.getNode("controls/fuel/switches/pump-center-2"),
|
||||
pumpRight1: props.globals.getNode("controls/fuel/switches/pump-right-1"),
|
||||
pumpRight2: props.globals.getNode("controls/fuel/switches/pump-right-2"),
|
||||
centerTkMode: props.globals.getNode("/controls/fuel/switches/center-mode"),
|
||||
crossfeed: props.globals.getNode("/controls/fuel/switches/crossfeed"),
|
||||
pumpLeft1: props.globals.getNode("/controls/fuel/switches/pump-left-1"),
|
||||
pumpLeft2: props.globals.getNode("/controls/fuel/switches/pump-left-2"),
|
||||
pumpCenter1: props.globals.getNode("/controls/fuel/switches/pump-center-1"),
|
||||
pumpCenter2: props.globals.getNode("/controls/fuel/switches/pump-center-2"),
|
||||
pumpRight1: props.globals.getNode("/controls/fuel/switches/pump-right-1"),
|
||||
pumpRight2: props.globals.getNode("/controls/fuel/switches/pump-right-2"),
|
||||
},
|
||||
Pumps: {
|
||||
apu: props.globals.getNode("systems/fuel/pumps/apu-operate"),
|
||||
allOff: props.globals.getNode("systems/fuel/pumps/all-eng-pump-off"),
|
||||
apu: props.globals.getNode("/systems/fuel/pumps/apu-operate"),
|
||||
allOff: props.globals.getNode("/systems/fuel/pumps/all-eng-pump-off"),
|
||||
},
|
||||
Valves: {
|
||||
apu: props.globals.getNode("systems/fuel/valves/apu-lp-valve"),
|
||||
crossfeed: props.globals.getNode("systems/fuel/valves/crossfeed-valve"),
|
||||
lpValve1: props.globals.getNode("systems/fuel/valves/engine-1-lp-valve"),
|
||||
lpValve2: props.globals.getNode("systems/fuel/valves/engine-2-lp-valve"),
|
||||
transfer1: props.globals.getNode("systems/fuel/valves/outer-inner-transfer-valve-1"),
|
||||
transfer2: props.globals.getNode("systems/fuel/valves/outer-inner-transfer-valve-2"),
|
||||
refuelLeft: props.globals.getNode("systems/fuel/refuel/left-valve"),
|
||||
refuelCenter: props.globals.getNode("systems/fuel/refuel/center-valve"),
|
||||
refuelRight: props.globals.getNode("systems/fuel/refuel/right-valve"),
|
||||
apu: props.globals.getNode("/systems/fuel/valves/apu-lp-valve"),
|
||||
crossfeed: props.globals.getNode("/systems/fuel/valves/crossfeed-valve"),
|
||||
lpValve1: props.globals.getNode("/systems/fuel/valves/engine-1-lp-valve"),
|
||||
lpValve2: props.globals.getNode("/systems/fuel/valves/engine-2-lp-valve"),
|
||||
transfer1: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-1"),
|
||||
transfer2: props.globals.getNode("/systems/fuel/valves/outer-inner-transfer-valve-2"),
|
||||
refuelLeft: props.globals.getNode("/systems/fuel/refuel/left-valve"),
|
||||
refuelCenter: props.globals.getNode("/systems/fuel/refuel/center-valve"),
|
||||
refuelRight: props.globals.getNode("/systems/fuel/refuel/right-valve"),
|
||||
},
|
||||
Quantity: {
|
||||
leftOuter: props.globals.getNode("consumables/fuel/tank[0]/level-lbs"),
|
||||
leftOuterPct: props.globals.getNode("consumables/fuel/tank[0]/level-norm"),
|
||||
leftInner: props.globals.getNode("consumables/fuel/tank[1]/level-lbs"),
|
||||
leftInnerPct: props.globals.getNode("consumables/fuel/tank[1]/level-norm"),
|
||||
center: props.globals.getNode("consumables/fuel/tank[2]/level-lbs"),
|
||||
centerPct: props.globals.getNode("consumables/fuel/tank[2]/level-norm"),
|
||||
rightInner: props.globals.getNode("consumables/fuel/tank[3]/level-lbs"),
|
||||
rightInnerPct: props.globals.getNode("consumables/fuel/tank[3]/level-norm"),
|
||||
rightOuter: props.globals.getNode("consumables/fuel/tank[4]/level-lbs"),
|
||||
rightOuterPct: props.globals.getNode("consumables/fuel/tank[4]/level-norm"),
|
||||
usedLeft: props.globals.getNode("systems/fuel/fuel-used-1"),
|
||||
usedRight: props.globals.getNode("systems/fuel/fuel-used-2"),
|
||||
leftOuter: props.globals.getNode("/consumables/fuel/tank[0]/level-lbs"),
|
||||
leftOuterPct: props.globals.getNode("/consumables/fuel/tank[0]/level-norm"),
|
||||
leftInner: props.globals.getNode("/consumables/fuel/tank[1]/level-lbs"),
|
||||
leftInnerPct: props.globals.getNode("/consumables/fuel/tank[1]/level-norm"),
|
||||
center: props.globals.getNode("/consumables/fuel/tank[2]/level-lbs"),
|
||||
centerPct: props.globals.getNode("/consumables/fuel/tank[2]/level-norm"),
|
||||
rightInner: props.globals.getNode("/consumables/fuel/tank[3]/level-lbs"),
|
||||
rightInnerPct: props.globals.getNode("/consumables/fuel/tank[3]/level-norm"),
|
||||
rightOuter: props.globals.getNode("/consumables/fuel/tank[4]/level-lbs"),
|
||||
rightOuterPct: props.globals.getNode("/consumables/fuel/tank[4]/level-norm"),
|
||||
offsetLeft: props.globals.getNode("/systems/fuel/offset-left"),
|
||||
offsetRight: props.globals.getNode("/systems/fuel/offset-right"),
|
||||
},
|
||||
resetFail: func() {
|
||||
me.Fail.pumpLeft1.setValue(0);
|
||||
|
@ -68,13 +68,11 @@ var FUEL = {
|
|||
init: func() {
|
||||
me.resetFail();
|
||||
},
|
||||
loop: func() {
|
||||
systems.FUEL.Quantity.usedLeft.setValue(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue() + me.offset1);
|
||||
systems.FUEL.Quantity.usedRight.setValue(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue() + me.offset2);
|
||||
setOffsetLeft: func() {
|
||||
me.Quantity.offsetLeft.setValue(me.Quantity.offsetLeft.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
|
||||
},
|
||||
setOffset: func() {
|
||||
me.offset1 = me.offset1 -(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[0].getValue());
|
||||
me.offset2 = me.offset2 -(pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue());
|
||||
setOffsetRight: func() {
|
||||
me.Quantity.offsetRight.setValue(me.Quantity.offsetRight.getValue() - pts.Fdm.JSBsim.Propulsion.Engine.fuelUsed[1].getValue());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -83,6 +81,8 @@ setlistener("/engines/engine[0]/state", func() {
|
|||
FUEL.timeEngStart = pts.Sim.Time.elapsedSec.getValue();
|
||||
FUEL.cmdCtrOn.setValue(1);
|
||||
ctrTkTimer.start();
|
||||
} elsif (pts.Engines.Engine.state[0].getValue() == 2) {
|
||||
FUEL.setOffsetLeft();
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
|
@ -91,6 +91,8 @@ setlistener("/engines/engine[1]/state", func() {
|
|||
FUEL.timeEngStart = pts.Sim.Time.elapsedSec.getValue();
|
||||
FUEL.cmdCtrOn.setValue(1);
|
||||
ctrTkTimer.start();
|
||||
} elsif (pts.Engines.Engine.state[1].getValue() == 2) {
|
||||
FUEL.setOffsetRight();
|
||||
}
|
||||
}, 0, 0);
|
||||
|
||||
|
|
|
@ -3,15 +3,9 @@
|
|||
|
||||
# Copyright (c) 2019 Jonathan Redpath
|
||||
|
||||
var accum = 0;
|
||||
var parking = 0;
|
||||
var askidnws_sw = 0;
|
||||
var down = 0;
|
||||
|
||||
var HYD = {
|
||||
Brakes: {
|
||||
accumPressPsi: props.globals.initNode("/systems/hydraulic/brakes/accumulator-pressure-psi", 0, "INT"),
|
||||
accumPressPsi1: props.globals.initNode("/systems/hydraulic/brakes/accumulator-pressure-psi-1", 0, "INT"),
|
||||
leftPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-left-psi", 0, "INT"),
|
||||
rightPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-right-psi", 0, "INT"),
|
||||
askidSw: props.globals.initNode("/systems/hydraulic/brakes/askidnwssw", 1, "BOOL"),
|
||||
|
@ -85,30 +79,16 @@ var HYD = {
|
|||
me.Fail.yellowLeak.setBoolValue(0);
|
||||
},
|
||||
loop: func() {
|
||||
accum = me.Brakes.accumPressPsi.getValue();
|
||||
parking = getprop("/controls/gear/brake-parking");
|
||||
askidnws_sw = me.Brakes.askidSw.getBoolValue();
|
||||
|
||||
if (!parking and askidnws_sw and me.Psi.green.getValue() > 2500) {
|
||||
# set mode to on
|
||||
me.Brakes.mode.setValue(1);
|
||||
} else if ((!parking and askidnws_sw and me.Psi.yellow.getValue() > 2500) or (!parking and askidnws_sw and accum > 0)) {
|
||||
# set mode to altn
|
||||
me.Brakes.mode.setValue(2);
|
||||
} else {
|
||||
# set mode to off
|
||||
me.Brakes.mode.setValue(0);
|
||||
}
|
||||
|
||||
if (me.Brakes.mode.getValue() == 2 and me.Psi.yellow.getValue() > 2500 and accum < 700) {
|
||||
me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() + 50);
|
||||
if (me.Brakes.mode.getValue() == 2) {
|
||||
if (me.Psi.yellow.getValue() > 2500 and me.Brakes.accumPressPsi.getValue() < 700) {
|
||||
me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() + 50);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
setlistener("/controls/gear/gear-down", func {
|
||||
down = getprop("/controls/gear/gear-down");
|
||||
if (!down and (getprop("gear/gear[0]/wow") or getprop("gear/gear[1]/wow") or getprop("gear/gear[2]/wow"))) {
|
||||
setprop("/controls/gear/gear-down", 1);
|
||||
if (!pts.Controls.Gear.gearDown.getValue() and (pts.Gear.wow[0].getValue() or pts.Gear.wow[1].getValue() or pts.Gear.wow[2].getValue())) {
|
||||
pts.Controls.Gear.gearDown.setValue(1);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -8,10 +8,7 @@ var ambient = nil;
|
|||
var cabinpsi = nil;
|
||||
var state1 = nil;
|
||||
var state2 = nil;
|
||||
var stateL = nil;
|
||||
var stateR = nil;
|
||||
var pressmode = nil;
|
||||
var wowc = nil;
|
||||
var wowl = nil;
|
||||
var wowr = nil;
|
||||
var vs = nil;
|
||||
|
@ -135,12 +132,9 @@ var PNEU = {
|
|||
setprop("/systems/pressurization/pack-2-comp-out-temp", 0);
|
||||
setprop("/systems/pressurization/pack-1-valve", 0);
|
||||
setprop("/systems/pressurization/pack-2-valve", 0);
|
||||
setprop("/systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
setprop("/systems/ventilation/avionics/fan", 0);
|
||||
setprop("/systems/ventilation/avionics/extractvalve", "0");
|
||||
setprop("/systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 0);
|
||||
setprop("/systems/ventilation/lavatory/extractvalve", "0");
|
||||
#setprop("/systems/ventilation/cabin/fans", 0); # aircon fans
|
||||
#setprop("/systems/ventilation/avionics/extractvalve", "0");
|
||||
#setprop("/systems/ventilation/avionics/inletvalve", "0");
|
||||
setprop("/controls/oxygen/masksDeploy", 0);
|
||||
setprop("/controls/oxygen/masksDeployMan", 0);
|
||||
setprop("/controls/oxygen/masksReset", 0); # this is the TMR RESET pb on the maintenance panel, needs 3D model
|
||||
|
@ -163,26 +157,8 @@ var PNEU = {
|
|||
me.Fail.xbleed.setBoolValue(0);
|
||||
},
|
||||
loop: func() {
|
||||
stateL = getprop("engines/engine[0]/state");
|
||||
stateR = getprop("engines/engine[1]/state");
|
||||
wowc = getprop("gear/gear[0]/wow");
|
||||
wowl = getprop("gear/gear[1]/wow");
|
||||
wowr = getprop("gear/gear[2]/wow");
|
||||
eng1_starter = getprop("/systems/pneumatics/valves/starter-valve-1");
|
||||
eng2_starter = getprop("/systems/pneumatics/valves/starter-valve-2");
|
||||
if (stateL == 1 or stateR == 1 or stateL == 2 or stateR == 2) {
|
||||
setprop("/systems/pneumatics/start-psi", 18);
|
||||
} else {
|
||||
setprop("/systems/pneumatics/start-psi", 0);
|
||||
}
|
||||
|
||||
if (getprop("/controls/engines/engine-start-switch") == 2 and wowc == 1 and (stateL != 3 or stateR != 3)) {
|
||||
setprop("/systems/pneumatics/starting", 1);
|
||||
} else if (wowc == 1 and eng1_starter == 1 or eng2_starter == 1) {
|
||||
setprop("/systems/pneumatics/starting", 1);
|
||||
} else {
|
||||
setprop("/systems/pneumatics/starting", 0);
|
||||
}
|
||||
|
||||
# Legacy pressurization
|
||||
cabinalt = getprop("/systems/pressurization/cabinalt");
|
||||
|
@ -220,20 +196,11 @@ var PNEU = {
|
|||
setprop("/systems/pressurization/cabinalt", cabinalt + ((manvs / 60) / 10));
|
||||
}
|
||||
|
||||
if (ditch and auto) {
|
||||
setprop("/systems/pressurization/outflowpos", "1");
|
||||
setprop("/systems/ventilation/avionics/extractvalve", "1");
|
||||
setprop("/systems/ventilation/avionics/inletvalve", "1");
|
||||
}
|
||||
|
||||
if (systems.ELEC.Bus.dcEss.getValue() >= 25 or systems.ELEC.Bus.acEss.getValue() > 110) {
|
||||
setprop("/systems/ventilation/avionics/fan", 1);
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 1);
|
||||
} else {
|
||||
setprop("/systems/ventilation/avionics/fan", 0);
|
||||
setprop("/systems/ventilation/lavatory/extractfan", 0);
|
||||
}
|
||||
|
||||
#if (ditch and auto) {
|
||||
#setprop("/systems/pressurization/outflowpos", "1");
|
||||
#setprop("/systems/ventilation/avionics/extractvalve", "1");
|
||||
#setprop("/systems/ventilation/avionics/inletvalve", "1");
|
||||
#}
|
||||
|
||||
# Oxygen
|
||||
if (cabinalt > 13500) {
|
||||
|
|
|
@ -8,8 +8,7 @@ var tyresmoke_2 = aircraft.tyresmoke.new(2, 0, 0.8, 0);
|
|||
|
||||
# =============================== listeners ===============================
|
||||
setlistener("gear/gear[0]/position-norm", func {
|
||||
var gear = getprop("gear/gear[0]/position-norm");
|
||||
if (gear == 1 ){
|
||||
if (pts.Gear.position[0].getValue()){
|
||||
run_tyresmoke0 = 1;
|
||||
}else{
|
||||
run_tyresmoke0 = 0;
|
||||
|
@ -17,8 +16,7 @@ setlistener("gear/gear[0]/position-norm", func {
|
|||
},1,0);
|
||||
|
||||
setlistener("gear/gear[1]/position-norm", func {
|
||||
var gear = getprop("gear/gear[1]/position-norm");
|
||||
if (gear == 1 ){
|
||||
if (pts.Gear.position[1].getValue()){
|
||||
run_tyresmoke1 = 1;
|
||||
}else{
|
||||
run_tyresmoke1 = 0;
|
||||
|
@ -26,8 +24,7 @@ setlistener("gear/gear[1]/position-norm", func {
|
|||
},1,0);
|
||||
|
||||
setlistener("gear/gear[2]/position-norm", func {
|
||||
var gear = getprop("gear/gear[2]/position-norm");
|
||||
if (gear == 1 ){
|
||||
if (pts.Gear.position[2].getValue()){
|
||||
run_tyresmoke2 = 1;
|
||||
}else{
|
||||
run_tyresmoke2 = 0;
|
||||
|
|
Binary file not shown.
|
@ -544,9 +544,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -575,9 +574,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -606,9 +604,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -637,9 +634,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -668,9 +664,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
|
@ -699,9 +694,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
|
@ -730,9 +724,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -753,9 +746,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
|
|
@ -458,9 +458,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -489,9 +488,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -520,9 +518,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -551,9 +548,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -582,9 +578,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
|
@ -613,9 +608,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
|
|
|
@ -361,9 +361,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -392,9 +391,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -423,9 +421,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -454,9 +451,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>-1</x>
|
||||
|
@ -485,9 +481,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -508,9 +503,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<reference-dist>30</reference-dist>
|
||||
<position>
|
||||
|
@ -531,9 +525,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
|
@ -562,9 +555,8 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<volume>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<factor>-1</factor>
|
||||
<offset>1</offset>
|
||||
<property>/sim/sound/external-custom</property>
|
||||
<factor>1</factor>
|
||||
</volume>
|
||||
<orientation>
|
||||
<x>1</x>
|
||||
|
|
|
@ -75,51 +75,19 @@
|
|||
|
||||
<fcs_function name="/systems/navigation/probes/tat-1/compute-tat">
|
||||
<function>
|
||||
<difference>
|
||||
<product>
|
||||
<sum>
|
||||
<property>/environment/temperature-degc</property> <!-- SAT -->
|
||||
<value>273.15</value>
|
||||
</sum>
|
||||
<sum>
|
||||
<value>1</value>
|
||||
<product>
|
||||
<value>0.2</value> <!-- ratio of specific heats - 1 / 2 -->
|
||||
<value>0.995</value> <!-- empirical recovery factor -->
|
||||
<pow>
|
||||
<property>velocities/mach</property> <!-- going to use the pure value of mach here and then calculate another value -->
|
||||
<value>2</value>
|
||||
</pow>
|
||||
</product>
|
||||
</sum>
|
||||
</product>
|
||||
<value>273.15</value>
|
||||
</difference>
|
||||
<product>
|
||||
<value>0.995</value> <!-- empirical recovery factor -->
|
||||
<property>propulsion/tat-c</property>
|
||||
</product>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
<fcs_function name="/systems/navigation/probes/tat-2/compute-tat">
|
||||
<function>
|
||||
<difference>
|
||||
<product>
|
||||
<sum>
|
||||
<property>/environment/temperature-degc</property> <!-- SAT -->
|
||||
<value>273.15</value>
|
||||
</sum>
|
||||
<sum>
|
||||
<value>1</value>
|
||||
<product>
|
||||
<value>0.2</value> <!-- ratio of specific heats - 1 / 2 -->
|
||||
<value>0.996</value> <!-- empirical recovery factor -->
|
||||
<pow>
|
||||
<property>velocities/mach</property> <!-- going to use the pure value of mach here and then calculate another value -->
|
||||
<value>2</value>
|
||||
</pow>
|
||||
</product>
|
||||
</sum>
|
||||
</product>
|
||||
<value>273.15</value>
|
||||
</difference>
|
||||
<product>
|
||||
<value>0.996</value> <!-- empirical recovery factor -->
|
||||
<property>propulsion/tat-c</property>
|
||||
</product>
|
||||
</function>
|
||||
</fcs_function>
|
||||
|
||||
|
|
|
@ -410,6 +410,16 @@
|
|||
|
||||
<channel name="Flow Rates" execrate="2">
|
||||
|
||||
<summer name="/systems/fuel/fuel-used-1">
|
||||
<input>/systems/fuel/offset-left</input>
|
||||
<input>propulsion/engine[0]/fuel-used-lbs</input>
|
||||
</summer>
|
||||
|
||||
<summer name="/systems/fuel/fuel-used-2">
|
||||
<input>/systems/fuel/offset-right</input>
|
||||
<input>propulsion/engine[1]/fuel-used-lbs</input>
|
||||
</summer>
|
||||
|
||||
<switch name="/systems/fuel/feed-left-inner">
|
||||
<default value="0"/>
|
||||
<test logic="OR" value="1">
|
||||
|
|
|
@ -500,6 +500,27 @@
|
|||
|
||||
</channel>
|
||||
|
||||
<channel name="Brakes" execrate="8">
|
||||
|
||||
<switch name="/systems/hydraulic/brakes/mode">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/controls/gear/brake-parking ne 1
|
||||
/systems/hydraulic/brakes/askidnwssw eq 1
|
||||
/systems/hydraulic/green-psi ge 2500
|
||||
</test>
|
||||
<test logic="AND" value="2">
|
||||
/controls/gear/brake-parking ne 1
|
||||
/systems/hydraulic/brakes/askidnwssw eq 1
|
||||
/systems/hydraulic/yellow-psi ge 2500
|
||||
</test>
|
||||
<test logic="AND" value="2">
|
||||
/controls/gear/brake-parking ne 1
|
||||
/systems/hydraulic/brakes/accumulator-pressure-psi ge 0
|
||||
</test>
|
||||
</switch>
|
||||
</channel>
|
||||
|
||||
<channel name="Lights" execrate="8">
|
||||
|
||||
<switch name="/systems/hydraulic/lights/blue-elec-fault">
|
||||
|
|
32
Systems/a320-misc.xml
Normal file
32
Systems/a320-misc.xml
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!-- Airbus A320 Misc Systems -->
|
||||
|
||||
<!-- Copyright (c) 2020 Jonathan Redpath -->
|
||||
|
||||
<system name="A320: APU">
|
||||
|
||||
<channel name="CVR" execrate="8">
|
||||
|
||||
<switch name="/controls/CVR/power">
|
||||
<default value="0"/>
|
||||
<test logic="AND" value="1">
|
||||
/systems/electrical/bus/ac-ess ge 110
|
||||
<test logic="OR">
|
||||
/gear/gear[1]/wow eq 1
|
||||
/gear/gear[2]/wow eq 1
|
||||
</test>
|
||||
<test logic="OR">
|
||||
/controls/CVR/gndctl eq 1
|
||||
/engines/engine[0]/state eq 3
|
||||
/engines/engine[1]/state eq 3
|
||||
</test>
|
||||
</test>
|
||||
<test logic="AND" value="1">
|
||||
/systems/electrical/bus/ac-ess ge 110
|
||||
/gear/gear[1]/wow eq 0
|
||||
/gear/gear[2]/wow eq 0
|
||||
</test>
|
||||
</switch>
|
||||
|
||||
</channel>
|
||||
|
||||
</system>
|
|
@ -750,7 +750,7 @@
|
|||
</channel>
|
||||
|
||||
<channel name="System PSI" execrate="8">
|
||||
|
||||
|
||||
<fcs_function name="/systems/pneumatics/psi/engine-1-upstream-src">
|
||||
<function>
|
||||
<ifthen>
|
||||
|
|
|
@ -55,6 +55,18 @@
|
|||
<output>/sim/sound/internal-custom</output>
|
||||
</logic>
|
||||
|
||||
<logic>
|
||||
<input>
|
||||
<not>
|
||||
<equals>
|
||||
<property>/sim/sound/internal-custom</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</not>
|
||||
</input>
|
||||
<output>/sim/sound/external-custom</output>
|
||||
</logic>
|
||||
|
||||
<!-- Misc -->
|
||||
<filter>
|
||||
<type>gain</type>
|
||||
|
|
Loading…
Reference in a new issue