1
0
Fork 0

Merge branch 'dev' into flightplan-load

This commit is contained in:
legoboyvdlp R 2020-05-03 21:06:47 +01:00
commit 5d18b4c539
56 changed files with 65822 additions and 66662 deletions

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright (c) 2020 Josh Davidson (Octal450) -->
<!-- Copyright (c) 2020 Matthew Maring (hayden2000) -->
<!-- Copyright (c) 2020 Matthew Maring (mattmaring) -->
<PropertyList include="Aircraft/Generic/Human/Include/walker-include.xml">
<sim>
<author>Josh Davidson/Octal450 (Flight Dynamics, Systems, Displays), Jonathan Redpath/legoboyvdlp, merspieler, Matthew Maring/hayden2000 (Systems, Displays), Thorsten Herrmann/TH-555, Semir Gebran/CaptB (3D, Textures)</author>
<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>
<status>Pre V1.0</status>
@ -585,42 +585,6 @@
<footrest-cpt n="1" type="double">0</footrest-cpt>
<footrest-fo n="0" type="double">0</footrest-fo>
<footrest-fo n="1" type="double">0</footrest-fo>
<adirs n="0">
<adr n="0">
<fault type="bool">false</fault>
<off type="bool">false</off>
</adr>
<adr n="1">
<fault type="bool">false</fault>
<off type="bool">false</off>
</adr>
<adr n="2">
<fault type="bool">false</fault>
<off type="bool">false</off>
</adr>
<display>
<selected type="int">1</selected>
<dataknob type="int">5</dataknob>
<text type="string"></text>
</display>
<ir n="0">
<align type="bool">false</align>
<knob type="int">0</knob>
<fault type="bool">false</fault>
</ir>
<ir n="1">
<align type="bool">false</align>
<knob type="int">0</knob>
<fault type="bool">false</fault>
</ir>
<ir n="2">
<align type="bool">false</align>
<knob type="int">0</knob>
<fault type="bool">false</fault>
</ir>
<onbat type="bool">false</onbat>
<skip type="bool">0</skip>
</adirs>
<atc>
<system-knob type="int">0</system-knob>
<mode-knob type="int">0</mode-knob>
@ -639,6 +603,13 @@
<brake-left type="double">0</brake-left>
<brake-right type="double">0</brake-right>
</autobrake>
<CVR>
<erase type="bool">0</erase>
<gndctl type="bool">0</gndctl>
<power type="bool">0</power>
<test type="bool">0</test>
<tone type="bool">0</tone>
</CVR>
<electric>
<avionics-switch type="bool">true</avionics-switch>
</electric>
@ -812,9 +783,9 @@
<navigation>
<adirscp>
<switches>
<adr-1 type="bool">0</adr-1>
<adr-2 type="bool">0</adr-2>
<adr-3 type="bool">0</adr-3>
<adr-1 type="bool">1</adr-1>
<adr-2 type="bool">1</adr-2>
<adr-3 type="bool">1</adr-3>
<ir-1 type="bool">0</ir-1>
<ir-2 type="bool">0</ir-2>
<ir-3 type="bool">0</ir-3>
@ -826,9 +797,9 @@
<adr-1-fault type="bool">0</adr-1-fault>
<adr-2-fault type="bool">0</adr-2-fault>
<adr-3-fault type="bool">0</adr-3-fault>
<adr-1-off type="bool">1</adr-1-off>
<adr-2-off type="bool">1</adr-2-off>
<adr-3-off type="bool">1</adr-3-off>
<adr-1-off type="bool">0</adr-1-off>
<adr-2-off type="bool">0</adr-2-off>
<adr-3-off type="bool">0</adr-3-off>
<ir-1-fault type="bool">0</ir-1-fault>
<ir-2-fault type="bool">0</ir-2-fault>
<ir-3-fault type="bool">0</ir-3-fault>
@ -877,6 +848,13 @@
<wing-lights type="bool">0</wing-lights>
<landing-lights-l type="float">0.0</landing-lights-l>
<landing-lights-r type="float">0.0</landing-lights-r>
<LrainRpt type="bool">0</LrainRpt>
<RrainRpt type="bool">0</RrainRpt>
<emerCallLtO type="bool">0</emerCallLtO>
<emerCallLtC type="bool">0</emerCallLtC>
<cabinCall type="bool">0</cabinCall>
<emerCall type="bool">0</emerCall>
<mechCall type="bool">0</mechCall>
</switches>
<tray n="0">
<lefttrayext type="double">0</lefttrayext>
@ -996,15 +974,11 @@
<sources>
<bat-1>
<amps type="double">0</amps>
<limiter type="bool">0</limiter>
<percent type="double">80</percent>
<time type="int">0</time>
<percent-calc type="double">80</percent-calc>
</bat-1>
<bat-2>
<amps type="double">0</amps>
<limiter type="bool">0</limiter>
<percent type="double">80</percent>
<time type="int">0</time>
<percent-calc type="double">80</percent-calc>
</bat-2>
</sources>
</electrical>
@ -3966,7 +3940,6 @@
<file>Aircraft/A320-family/Nasal/Systems/hydraulics.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/fuel.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/FADEC/engines-common.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/ADIRS.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/ADR.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/ADIRS/SwitchingPanel.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/Comm/HF.nas</file>

View file

@ -45,11 +45,11 @@
</text>
<text>
<halign>left</halign>
<label>Systems: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (hayden2000)</label>
<label>Systems: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (mattmaring)</label>
</text>
<text>
<halign>left</halign>
<label>Displays: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (hayden2000)</label>
<label>Displays: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (mattmaring)</label>
</text>
<text>
<halign>left</halign>

View file

@ -385,15 +385,15 @@ var beforestart_b = func {
setprop("/controls/adirs/ir[0]/knob","1");
setprop("/controls/adirs/ir[1]/knob","1");
setprop("/controls/adirs/ir[2]/knob","1");
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
if (systems.ADIRSnew.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
if (systems.ADIRS.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
if (systems.ADIRS.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
if (systems.ADIRS.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
systems.ADIRSControlPanel.irModeSw(0, 1);
systems.ADIRSControlPanel.irModeSw(1, 1);
systems.ADIRSControlPanel.irModeSw(2, 1);
systems.ADIRSnew.ADIRunits[0].instAlign();
systems.ADIRSnew.ADIRunits[1].instAlign();
systems.ADIRSnew.ADIRunits[2].instAlign();
systems.ADIRS.ADIRunits[0].instAlign();
systems.ADIRS.ADIRunits[1].instAlign();
systems.ADIRS.ADIRunits[2].instAlign();
setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/switches/beacon", 1);
setprop("/controls/lighting/nav-lights-switch", 1);
@ -477,15 +477,15 @@ var taxi_b = func {
setprop("/controls/adirs/ir[0]/knob","1");
setprop("/controls/adirs/ir[1]/knob","1");
setprop("/controls/adirs/ir[2]/knob","1");
if (systems.ADIRSnew.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
if (systems.ADIRSnew.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
if (systems.ADIRSnew.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
if (systems.ADIRS.Switches.adrSw[0].getValue() != 1) { systems.ADIRSControlPanel.adrSw(0); }
if (systems.ADIRS.Switches.adrSw[1].getValue() != 1) { systems.ADIRSControlPanel.adrSw(1); }
if (systems.ADIRS.Switches.adrSw[2].getValue() != 1) { systems.ADIRSControlPanel.adrSw(2); }
systems.ADIRSControlPanel.irModeSw(0, 1);
systems.ADIRSControlPanel.irModeSw(1, 1);
systems.ADIRSControlPanel.irModeSw(2, 1);
systems.ADIRSnew.ADIRunits[0].instAlign();
systems.ADIRSnew.ADIRunits[1].instAlign();
systems.ADIRSnew.ADIRunits[2].instAlign();
systems.ADIRS.ADIRunits[0].instAlign();
systems.ADIRS.ADIRunits[1].instAlign();
systems.ADIRS.ADIRunits[2].instAlign();
setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/switches/beacon", 1);
setprop("/controls/switches/wing-lights", 1);

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -131,12 +131,14 @@ var apu_hz = props.globals.getNode("/systems/electrical/sources/apu/output-hertz
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/amp", 1);
var bat2_amps = props.globals.getNode("/systems/electrical/sources/bat-2/amp", 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);
@ -669,7 +671,7 @@ var canvas_lowerECAM_apu = {
me["APUGenHz"].setText(sprintf("%s", math.round(apu_hz.getValue())));
# APU Bleed
if (systems.ADIRSnew.Operating.adr[0].getValue() and (apu_master.getValue() == 1 or bleedapu.getValue() > 0)) {
if (systems.ADIRS.Operating.adr[0].getValue() and (apu_master.getValue() == 1 or bleedapu.getValue() > 0)) {
me["APUBleedPSI"].setColor(0.0509,0.7529,0.2941);
me["APUBleedPSI"].setText(sprintf("%s", math.round(bleedapu.getValue())));
} else {
@ -1210,7 +1212,7 @@ var canvas_lowerECAM_elec = {
me["Bat1Ampere"].setText(sprintf("%s", math.round(bat1_amps.getValue())));
me["Bat1Volt"].setText(sprintf("%s", math.round(bat1_volts.getValue())));
if (bat1_volts.getValue() >= 25 and bat1_volts.getValue() <= 31) {
if (bat1_volts.getValue() >= 24.95 and bat1_volts.getValue() <= 31.05) {
me["Bat1Volt"].setColor(0.0509,0.7529,0.2941);
} else {
me["Bat1Volt"].setColor(0.7333,0.3803,0);
@ -1222,11 +1224,11 @@ var canvas_lowerECAM_elec = {
me["Bat1Ampere"].setColor(0.0509,0.7529,0.2941);
}
if (!systems.ELEC.Source.Bat1.limiter.getBoolValue()) {
if (bat1_direction.getValue() == 0) {
me["BAT1-discharge"].hide();
me["BAT1-charge"].hide();
} else {
if (systems.ELEC.Bus.dcBat.getValue() > 25) {
if (bat1_direction.getValue() == -1) {
me["BAT1-charge"].show();
me["BAT1-discharge"].hide();
} else {
@ -1254,7 +1256,7 @@ var canvas_lowerECAM_elec = {
me["Bat2Ampere"].setText(sprintf("%s", math.round(bat2_amps.getValue())));
me["Bat2Volt"].setText(sprintf("%s", math.round(bat2_volts.getValue())));
if (bat2_volts.getValue() >= 25 and bat2_volts.getValue() <= 31) {
if (bat2_volts.getValue() >= 24.95 and bat2_volts.getValue() <= 31.05) {
me["Bat2Volt"].setColor(0.0509,0.7529,0.2941);
} else {
me["Bat2Volt"].setColor(0.7333,0.3803,0);
@ -1266,11 +1268,11 @@ var canvas_lowerECAM_elec = {
me["Bat2Ampere"].setColor(0.0509,0.7529,0.2941);
}
if (!systems.ELEC.Source.Bat2.limiter.getBoolValue()) {
if (bat2_direction.getValue() == 0) {
me["BAT2-discharge"].hide();
me["BAT2-charge"].hide();
} else {
if (systems.ELEC.Bus.dcBat.getValue() > 25) {
if (bat2_direction.getValue() == -1) {
me["BAT2-charge"].show();
me["BAT2-discharge"].hide();
} else {
@ -2884,10 +2886,14 @@ var canvas_lowerECAM_wheel = {
return m;
},
getKeys: func() {
return ["TAT","SAT","GW","UTCh","UTCm","GW-weight-unit","lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR","autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex",
"spoiler2Rrt","spoiler3Rex","spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt","spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf",
"spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf","spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text","accuonlyarrow","accuonly","braketemp1","normbrkhyd",
"braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock","noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1","BSCUrect2","BSCU1","BSCU2"];
return ["TAT","SAT","GW","UTCh","UTCm","GW-weight-unit","lgctltext","NORMbrk","NWStext","leftdoor","rightdoor","nosegeardoorL","nosegeardoorR",
"autobrk","autobrkind","NWS","NWSrect","normbrk-rect","altnbrk","normbrkhyd","spoiler1Rex","spoiler1Rrt","spoiler2Rex","spoiler2Rrt","spoiler3Rex",
"spoiler3Rrt","spoiler4Rex","spoiler4Rrt","spoiler5Rex","spoiler5Rrt","spoiler1Lex","spoiler1Lrt","spoiler2Lex","spoiler2Lrt",
"spoiler3Lex","spoiler3Lrt","spoiler4Lex","spoiler4Lrt","spoiler5Lex","spoiler5Lrt","spoiler1Rf","spoiler2Rf","spoiler3Rf","spoiler4Rf","spoiler5Rf",
"spoiler1Lf","spoiler2Lf","spoiler3Lf","spoiler4Lf","spoiler5Lf","ALTNbrk","altnbrkhyd","altnbrk-rect","antiskidtext","brakearrow","accupress_text",
"accuonlyarrow","accuonly","braketemp1","normbrkhyd","braketemp2","braketemp3","braketemp4","toparc1","toparc2","toparc3","toparc4","leftuplock",
"noseuplock","rightuplock","Triangle-Left1","Triangle-Left2","Triangle-Nose1","Triangle-Nose2","Triangle-Right1","Triangle-Right2","BSCUrect1",
"BSCUrect2","BSCU1","BSCU2","tirepress1","tirepress2","tirepress3","tirepress4","tirepress5","tirepress6"];
},
update: func() {
blue_psi = systems.HYD.Psi.blue.getValue();
@ -3402,6 +3408,12 @@ var canvas_lowerECAM_wheel = {
me["leftuplock"].hide();
me["noseuplock"].hide();
me["rightuplock"].hide();
me["tirepress1"].hide();
me["tirepress2"].hide();
me["tirepress3"].hide();
me["tirepress4"].hide();
me["tirepress5"].hide();
me["tirepress6"].hide();
me.updateBottomStatus();
},

View file

@ -12,7 +12,7 @@
viewBox="0 0 1024 1024"
version="1.1"
id="svg2"
inkscape:version="0.92.4 (unknown)"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="wheel.svg">
<metadata
id="metadata375">
@ -37,15 +37,15 @@
guidetolerance="10"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-width="1366"
inkscape:window-height="705"
id="namedview371"
showgrid="true"
inkscape:zoom="0.49537617"
inkscape:cx="95.098853"
inkscape:cy="639.56062"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:zoom="2.3145515"
inkscape:cx="701.70396"
inkscape:cy="947.29764"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid
@ -104,8 +104,7 @@
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="940.17981"
y="939.82428"
id="GW-weight-unit"
sodipodi:linespacing="0%"><tspan
id="GW-weight-unit"><tspan
sodipodi:role="line"
id="tspan3726-1-4-5-7-7"
x="940.17981"
@ -677,7 +676,7 @@
inkscape:transform-center-x="35.150155"
inkscape:transform-center-y="0.071443405" />
<path
style="opacity:1;fill:none;fill-opacity:1;stroke:#0dc04b;stroke-width:2.60787535;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="opacity:1;fill:none;fill-opacity:1;stroke:#cecdcd;stroke-width:2.60787535;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 474.92632,318.99999 c -9.60617,5.62651 -23.82998,8.88082 -38.54106,8.81793 -14.71109,-0.0629 -28.26087,-3.43594 -36.7147,-9.13967"
id="noseARCl"
inkscape:connector-curvature="0"
@ -1194,4 +1193,76 @@
id="accuonlyarrow"
d="m 455.91296,703.17921 -18.9725,-0.0474 -0.21778,-9.82525 -6.1844,0.0643 8.27299,-9.57748 7.82221,9.2942 -6.04447,0.16094 0.17459,6.94753 15.16732,0.13679 z"
style="fill:#0dc04b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
inkscape:label="#text4309"
id="tirepress1"
y="699.86157"
x="87.762543"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans'"
y="699.86157"
x="87.762543"
id="tspan995"
sodipodi:role="line">999</tspan></text>
<text
inkscape:label="#text4313"
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="245.75887"
y="700.53729"
id="tirepress2"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans'"
sodipodi:role="line"
id="tspan999"
x="245.75887"
y="700.53729">999</tspan></text>
<text
inkscape:label="#text4317"
id="tirepress4"
y="699.72504"
x="890.17999"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:32px;line-height:1.25"
y="699.72504"
x="890.17999"
id="tspan1003"
sodipodi:role="line">999</tspan></text>
<text
inkscape:label="#text4321"
xml:space="preserve"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="728.06555"
y="699.18237"
id="tirepress3"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans'"
sodipodi:role="line"
id="tspan1007"
x="728.06555"
y="699.18237">999</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="566.68469"
y="306.13068"
id="tirepress6"
inkscape:label="#text4317"><tspan
sodipodi:role="line"
id="tspan1011"
x="566.68469"
y="306.13068"
style="font-size:32px;line-height:1.25">999</tspan></text>
<text
id="tirepress5"
y="305.58801"
x="410.07892"
style="font-style:normal;font-weight:normal;line-height:0%;font-family:'Liberation Sans';letter-spacing:0px;word-spacing:0px;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"
inkscape:label="#text4321"><tspan
y="305.58801"
x="410.07892"
id="tspan1015"
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:32px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans'">999</tspan></text>
</svg>

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -1,7 +1,7 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var MCDU_1 = nil;
var MCDU_2 = nil;
@ -150,7 +150,7 @@ var pri_efob = props.globals.getNode("/FMGC/internal/pri-efob", 1);
var alt_efob = props.globals.getNode("/FMGC/internal/alt-efob", 1);
var fob = props.globals.getNode("/FMGC/internal/fob", 1);
var fffq_sensor = props.globals.getNode("/FMGC/internal/fffq-sensor", 1);
var gw = props.globals.getNode("/FMGC/internal/gw", 1);
var gw = props.globals.getNode("/FMGC/internal/fuel-pred-gw", 1);
var cg = props.globals.getNode("/FMGC/internal/cg", 1);
# PROG
@ -1356,17 +1356,17 @@ var canvas_MCDU_base = {
minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60));
sign2 = degrees2 >= 0 ? "E" : "W";
me["Simple_R2"].setText(abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
if (getprop("/systems/navigation/adr/operating-1") and getprop("/FMGC/internal/align1-done")) {
if (systems.ADIRS.ADIRunits[0].operative and getprop("/FMGC/internal/align1-done")) {
me["Simple_C3"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign ~ "/" ~ abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
} else {
me["Simple_C3"].setText("-----.--/-----.--");
}
if (getprop("/systems/navigation/adr/operating-2") and getprop("/FMGC/internal/align2-done")) {
if (systems.ADIRS.ADIRunits[1].operative and getprop("/FMGC/internal/align2-done")) {
me["Simple_C4"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign ~ "/" ~ abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
} else {
me["Simple_C4"].setText("-----.--/-----.--");
}
if (getprop("/systems/navigation/adr/operating-3") and getprop("/FMGC/internal/align3-done")) {
if (systems.ADIRS.ADIRunits[2].operative and getprop("/FMGC/internal/align3-done")) {
me["Simple_C5"].setText(abs(degrees) ~ "g" ~ minutes ~ " " ~ sign ~ "/" ~ abs(degrees2) ~ "g" ~ minutes2 ~ " " ~ sign2);
} else {
me["Simple_C5"].setText("-----.--/-----.--");
@ -1383,20 +1383,32 @@ var canvas_MCDU_base = {
me.showRightArrow(0, 0, 0, 0, 0, 1);
}
if (getprop("/systems/navigation/adr/operating-1") and systems.ADIRSnew.ADIRunits[0].inAlign == 0) {
if (systems.ADIRS.Operating.aligned[0].getValue()) {
if (systems.ADIRS.ADIRunits[0].mode == 2) {
me["Simple_C3S"].setText("IRS1 IN ATT");
} else {
me["Simple_C3S"].setText("IRS1 ALIGNED ON GPS");
}
} else {
me["Simple_C3S"].setText("IRS1 ALIGNING ON GPS");
}
if (getprop("/systems/navigation/adr/operating-2") and systems.ADIRSnew.ADIRunits[1].inAlign == 0) {
if (systems.ADIRS.Operating.aligned[1].getValue()) {
if (systems.ADIRS.ADIRunits[1].mode == 2) {
me["Simple_C4S"].setText("IRS2 IN ATT");
} else {
me["Simple_C4S"].setText("IRS2 ALIGNED ON GPS");
}
} else {
me["Simple_C4S"].setText("IRS2 ALIGNING ON GPS");
}
if (getprop("/systems/navigation/adr/operating-3") and systems.ADIRSnew.ADIRunits[2].inAlign == 0) {
if (systems.ADIRS.Operating.aligned[2].getValue()) {
if (systems.ADIRS.ADIRunits[2].mode == 2) {
me["Simple_C5S"].setText("IRS3 IN ATT");
} else {
me["Simple_C5S"].setText("IRS3 ALIGNED ON GPS");
}
} else {
me["Simple_C5S"].setText("IRS3 ALIGNING ON GPS");
}
@ -1692,7 +1704,7 @@ var canvas_MCDU_base = {
me["Simple_L6"].setText(sprintf("%2.1f", min_dest_fob.getValue()));
setprop("/FMGC/internal/fob", num(getprop("/consumables/fuel/total-fuel-lbs") / 1000));
setprop("/FMGC/internal/gw", num(getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000));
setprop("/FMGC/internal/fuel-pred-gw", num(getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000));
setprop("/FMGC/internal/cg", num(getprop("/FMGC/internal/zfwcg")));
me["Simple_R4"].setText(sprintf("%4.1f/" ~ fffq_sensor.getValue(), fob.getValue()));
me["Simple_R5"].setText(sprintf("%4.1f/", gw.getValue()) ~ sprintf("%4.1f", cg.getValue()));

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -34,11 +34,11 @@
<object-name>FAC1Btn1F</object-name>
<object-name>FAC1Btn2O</object-name>
<object-name>IR1Btn1F</object-name>
<object-name>IR1Btn2A</object-name>
<object-name>IR1Btn2O</object-name>
<object-name>IR2Btn1F</object-name>
<object-name>IR2Btn2A</object-name>
<object-name>IR2Btn2O</object-name>
<object-name>IR3Btn1F</object-name>
<object-name>IR3Btn2A</object-name>
<object-name>IR3Btn2O</object-name>
<object-name>RamAirBtn2O</object-name>
<object-name>SEC1Btn1F</object-name>
<object-name>SEC1Btn2O</object-name>
@ -538,8 +538,8 @@
<binding>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() + 1);
if (systems.ADIRS.Switches.irModeSw[0].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRS.Switches.irModeSw[0].getValue() + 1);
} else {
systems.ADIRSControlPanel.irModeSw(0, 0);
}
@ -557,8 +557,8 @@
<binding>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() - 1);
if (systems.ADIRS.Switches.irModeSw[0].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRS.Switches.irModeSw[0].getValue() - 1);
} else {
systems.ADIRSControlPanel.irModeSw(0, 2);
}
@ -608,7 +608,7 @@
</animation>
<animation>
<type>select</type>
<object-name>IR1Btn2A</object-name>
<object-name>IR1Btn2O</object-name>
<condition>
<or>
<equals>
@ -634,8 +634,8 @@
<binding>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() + 1);
if (systems.ADIRS.Switches.irModeSw[1].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRS.Switches.irModeSw[1].getValue() + 1);
} else {
systems.ADIRSControlPanel.irModeSw(1, 0);
}
@ -653,8 +653,8 @@
<binding>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() - 1);
if (systems.ADIRS.Switches.irModeSw[1].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRS.Switches.irModeSw[1].getValue() - 1);
} else {
systems.ADIRSControlPanel.irModeSw(1, 2);
}
@ -704,7 +704,7 @@
</animation>
<animation>
<type>select</type>
<object-name>IR2Btn2A</object-name>
<object-name>IR2Btn2O</object-name>
<condition>
<or>
<equals>
@ -730,8 +730,8 @@
<binding>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() + 1);
if (systems.ADIRS.Switches.irModeSw[2].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRS.Switches.irModeSw[2].getValue() + 1);
} else {
systems.ADIRSControlPanel.irModeSw(2, 0);
}
@ -749,8 +749,8 @@
<binding>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() - 1);
if (systems.ADIRS.Switches.irModeSw[2].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRS.Switches.irModeSw[2].getValue() - 1);
} else {
systems.ADIRSControlPanel.irModeSw(2, 2);
}
@ -800,7 +800,7 @@
</animation>
<animation>
<type>select</type>
<object-name>IR3Btn2A</object-name>
<object-name>IR3Btn2O</object-name>
<condition>
<or>
<equals>
@ -6268,7 +6268,7 @@
<axis-alignment>xy-plane</axis-alignment>
<type type="string">number-value</type>
<format type="string">%2.1f</format>
<property>systems/electrical/sources/bat-1/volt</property>
<property>systems/electrical/bus/dc-hot-1</property>
<font type="string">led.txf</font>
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
@ -6320,7 +6320,7 @@
<axis-alignment>xy-plane</axis-alignment>
<type type="string">number-value</type>
<format type="string">%2.1f</format>
<property>systems/electrical/sources/bat-2/volt</property>
<property>systems/electrical/bus/dc-hot-2</property>
<font type="string">led.txf</font>
<draw-text type="bool">true</draw-text>
<draw-alignment type="bool">false</draw-alignment>
@ -7158,7 +7158,7 @@
</greater-than-equals>
</condition>
<command>nasal</command>
<script>libraries.MechCall();</script>
<script>libraries.MechCallFunc();</script>
</binding>
</action>
</animation>
@ -7177,7 +7177,7 @@
</greater-than-equals>
</condition>
<command>nasal</command>
<script>libraries.CabinCall();</script>
<script>libraries.CabinCallFunc();</script>
</binding>
</action>
</animation>

File diff suppressed because it is too large Load diff

View file

@ -1050,7 +1050,7 @@ var canvas_PFD_1 = {
wow2_act = wow2.getValue();
# Errors
if (systems.ADIRSnew.ADIRunits[0].aligned == 1 or (systems.ADIRSnew.ADIRunits[2].aligned == 1 and att_switch.getValue() == -1)) {
if (systems.ADIRS.ADIRunits[0].aligned == 1 or (systems.ADIRS.ADIRunits[2].aligned == 1 and att_switch.getValue() == -1)) {
me["AI_group"].show();
me["HDG_group"].show();
me["AI_error"].hide();
@ -1788,7 +1788,7 @@ var canvas_PFD_2 = {
wow2_act = wow2.getValue();
# Errors
if (systems.ADIRSnew.ADIRunits[1].aligned == 1 or (systems.ADIRSnew.ADIRunits[2].aligned == 1 and att_switch.getValue() == 1)) {
if (systems.ADIRS.ADIRunits[1].aligned == 1 or (systems.ADIRS.ADIRunits[2].aligned == 1 and att_switch.getValue() == 1)) {
me["AI_group"].show();
me["HDG_group"].show();
me["AI_error"].hide();

File diff suppressed because it is too large Load diff

View file

@ -47,7 +47,7 @@ var DMC = {
me.outputs[6] = nil;
},
update: func() {
if (systems.ADIRSnew.ADIRunits[me.activeADIRS].operative and systems.ADIRSnew.ADIRunits[me.activeADIRS].outputOn) {
if (systems.ADIRS.ADIRunits[me.activeADIRS].operative and systems.ADIRS.ADIRunits[me.activeADIRS].outputOn) {
if (me._set != 1) {
me._setNil = 0;
me.setOutputs(me.activeADIRS);

View file

@ -72,7 +72,7 @@ var messages_priority_3 = func {
if (getprop("systems/navigation/adr/computation/overspeed-vfe")) {
overspeedFlap.active = 1;
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRSnew.overspeedVFE.getValue() - 4);
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRS.overspeedVFE.getValue() - 4);
} else {
ECAM_controller.warningReset(overspeedFlap);
overspeedFlap.msg = "-VFE................XXX";
@ -1214,7 +1214,7 @@ var messages_priority_2 = func {
}
# APU AUTO SHUT DOWN
if (apuEmerShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and !systems.APUController.APU.signals.emer and !getprop("systems/fire/apu/warning-active") and (phaseVar == 6 or phaseVar >= 9 or phaseVar <= 2)) {
if (apuAutoShutdown.clearFlag == 0 and systems.APUController.APU.signals.autoshutdown and !systems.APUController.APU.signals.emer and !getprop("systems/fire/apu/warning-active") and (phaseVar == 6 or phaseVar >= 9 or phaseVar <= 2)) {
apuAutoShutdown.active = 1;
} elsif (apuAutoShutdown.clearFlag == 1) {
ECAM_controller.warningReset(apuAutoShutdown);
@ -1496,7 +1496,7 @@ var messages_memo = func {
refuelg.active = 0;
}
if ((phaseVar == 1 or phaseVar == 2) and toMemoLine1.active != 1 and ldgMemoLine1.active != 1 and (systems.ADIRSnew.ADIRunits[0].inAlign == 1 or systems.ADIRSnew.ADIRunits[1].inAlign == 1 or systems.ADIRSnew.ADIRunits[2].inAlign == 1)) {
if ((phaseVar == 1 or phaseVar == 2) and toMemoLine1.active != 1 and ldgMemoLine1.active != 1 and (systems.ADIRS.ADIRunits[0].inAlign == 1 or systems.ADIRS.ADIRunits[1].inAlign == 1 or systems.ADIRS.ADIRunits[2].inAlign == 1)) {
irs_in_align.active = 1;
if (getprop("ECAM/phases/timer/eng1or2-output")) {
irs_in_align.colour = "a";
@ -1505,7 +1505,7 @@ var messages_memo = func {
}
timeNow = pts.Sim.Time.elapsedSec.getValue();
numberMinutes = math.round(math.max(systems.ADIRSnew.ADIRunits[0]._alignTime - timeNow, systems.ADIRSnew.ADIRunits[1]._alignTime - timeNow, systems.ADIRSnew.ADIRunits[2]._alignTime - timeNow) / 60);
numberMinutes = math.round(math.max(systems.ADIRS.ADIRunits[0]._alignTime - timeNow, systems.ADIRS.ADIRunits[1]._alignTime - timeNow, systems.ADIRS.ADIRunits[2]._alignTime - timeNow) / 60);
if (numberMinutes >= 7) {
irs_in_align.msg = "IRS IN ALIGN > 7 MN";

View file

@ -147,9 +147,9 @@ setlistener("/gear/gear[0]/wow-fmgc", func {
});
var trimReset = func {
gear0 = getprop("gear/gear[0]/wow");
flaps = getprop("controls/flight/flap-pos");
if (gear0 == 1 and getprop("FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
gear0 = getprop("/gear/gear[0]/wow");
flaps = getprop("/controls/flight/flap-pos");
if (gear0 == 1 and getprop("/FMGC/status/to-state") == 0 and (flaps >= 5 or (flaps >= 4 and getprop("/instrumentation/mk-viii/inputs/discretes/momentary-flap3-override") == 1))) {
interpolate("/controls/flight/elevator-trim", 0.0, 1.5);
}
}
@ -159,19 +159,19 @@ var trimReset = func {
###############
var updateARPT = func {
dep = getprop("FMGC/internal/dep-arpt");
arr = getprop("FMGC/internal/arr-arpt");
alt = getprop("FMGC/internal/alt-airport");
dep = getprop("/FMGC/internal/dep-arpt");
arr = getprop("/FMGC/internal/arr-arpt");
alt = getprop("/FMGC/internal/alt-airport");
setprop("autopilot/route-manager/departure/airport", dep);
setprop("autopilot/route-manager/destination/airport", arr);
setprop("autopilot/route-manager/alternate/airport", alt);
if (getprop("autopilot/route-manager/active") != 1) {
if (getprop("/autopilot/route-manager/active") != 1) {
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
}
}
setlistener("/FMGC/internal/cruise-ft", func {
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("FMGC/internal/cruise-ft"));
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("/FMGC/internal/cruise-ft"));
});
############################
@ -179,48 +179,48 @@ setlistener("/FMGC/internal/cruise-ft", func {
############################
var masterFMGC = maketimer(0.2, func {
n1_left = getprop("engines/engine[0]/n1-actual");
n1_right = getprop("engines/engine[1]/n1-actual");
flaps = getprop("controls/flight/flap-pos");
modelat = getprop("modes/pfd/fma/roll-mode");
mode = getprop("modes/pfd/fma/pitch-mode");
modeI = getprop("it-autoflight/mode/vert");
gs = getprop("velocities/groundspeed-kt");
alt = getprop("instrumentation/altimeter/indicated-altitude-ft");
n1_left = getprop("/engines/engine[0]/n1-actual");
n1_right = getprop("/engines/engine[1]/n1-actual");
flaps = getprop("/controls/flight/flap-pos");
modelat = getprop("/modes/pfd/fma/roll-mode");
mode = getprop("/modes/pfd/fma/pitch-mode");
modeI = getprop("/it-autoflight/mode/vert");
gs = getprop("/velocities/groundspeed-kt");
alt = getprop("/instrumentation/altimeter/indicated-altitude-ft");
aglalt = pts.Position.gearAglFt.getValue();
cruiseft = getprop("FMGC/internal/cruise-ft");
cruiseft_b = getprop("FMGC/internal/cruise-ft") - 200;
newcruise = getprop("it-autoflight/internal/alt");
phase = getprop("FMGC/status/phase");
state1 = getprop("systems/thrust/state1");
state2 = getprop("systems/thrust/state2");
wowl = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
targetalt = getprop("it-autoflight/internal/alt");
targetvs = getprop("it-autoflight/input/vs");
targetfpa = getprop("it-autoflight/input/fpa");
accel_agl_ft = getprop("it-autoflight/settings/accel-agl-ft");
locarm = getprop("it-autopilot/output/loc-armed");
apprarm = getprop("it-autopilot/output/appr-armed");
gear0 = getprop("gear/gear[0]/wow");
ap1 = getprop("it-autoflight/output/ap1");
ap2 = getprop("it-autoflight/output/ap2");
flx = getprop("systems/thrust/lim-flex");
lat = getprop("it-autoflight/mode/lat");
newlat = getprop("modes/pfd/fma/roll-mode");
vert = getprop("it-autoflight/mode/vert");
newvert = getprop("modes/pfd/fma/pitch-mode");
newvertarm = getprop("modes/pfd/fma/pitch-mode2-armed");
thr1 = getprop("controls/engines/engine[0]/throttle-pos");
thr2 = getprop("controls/engines/engine[1]/throttle-pos");
gear0 = getprop("gear/gear[0]/wow");
state1 = getprop("systems/thrust/state1");
state2 = getprop("systems/thrust/state2");
altSel = getprop("it-autoflight/input/alt");
crzFl = getprop("FMGC/internal/cruise-fl");
cruiseft = getprop("/FMGC/internal/cruise-ft");
cruiseft_b = getprop("/FMGC/internal/cruise-ft") - 200;
newcruise = getprop("/it-autoflight/internal/alt");
phase = getprop("/FMGC/status/phase");
state1 = getprop("/systems/thrust/state1");
state2 = getprop("/systems/thrust/state2");
wowl = getprop("/gear/gear[1]/wow");
wowr = getprop("/gear/gear[2]/wow");
targetalt = getprop("/it-autoflight/internal/alt");
targetvs = getprop("/it-autoflight/input/vs");
targetfpa = getprop("/it-autoflight/input/fpa");
accel_agl_ft = getprop("/it-autoflight/settings/accel-agl-ft");
locarm = getprop("/it-autopilot/output/loc-armed");
apprarm = getprop("/it-autopilot/output/appr-armed");
gear0 = getprop("/gear/gear[0]/wow");
ap1 = getprop("/it-autoflight/output/ap1");
ap2 = getprop("/it-autoflight/output/ap2");
flx = getprop("/systems/thrust/lim-flex");
lat = getprop("/it-autoflight/mode/lat");
newlat = getprop("/modes/pfd/fma/roll-mode");
vert = getprop("/it-autoflight/mode/vert");
newvert = getprop("/modes/pfd/fma/pitch-mode");
newvertarm = getprop("/modes/pfd/fma/pitch-mode2-armed");
thr1 = getprop("/controls/engines/engine[0]/throttle-pos");
thr2 = getprop("/controls/engines/engine[1]/throttle-pos");
gear0 = getprop("/gear/gear[0]/wow");
state1 = getprop("/systems/thrust/state1");
state2 = getprop("/systems/thrust/state2");
altSel = getprop("/it-autoflight/input/alt");
crzFl = getprop("/FMGC/internal/cruise-fl");
if (getprop("gear/gear[0]/wow") != getprop("gear/gear[0]/wow-fmgc")) {
setprop("gear/gear[0]/wow-fmgc", getprop("gear/gear[0]/wow"));
if (getprop("/gear/gear[0]/wow") != getprop("/gear/gear[0]/wow-fmgc")) {
setprop("gear/gear[0]/wow-fmgc", getprop("/gear/gear[0]/wow"));
}
if ((n1_left < 85 or n1_right < 85) and gs < 90 and mode == " " and gear0 == 1 and phase == 1) { # rejected takeoff
@ -275,21 +275,21 @@ var masterFMGC = maketimer(0.2, func {
setprop("FMGC/status/phase", 2);
}
if (getprop("systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
setprop("FMGC/internal/maxspeed", getprop("systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
setprop("FMGC/internal/maxspeed", getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
} elsif (pts.Gear.position[0].getValue() != 0 or pts.Gear.position[1].getValue() != 0 or pts.Gear.position[2].getValue() != 0) {
setprop("FMGC/internal/maxspeed", 284);
} else {
setprop("FMGC/internal/maxspeed", getprop("it-fbw/speeds/vmo-mmo"));
setprop("FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
}
# calculate speeds
flap = getprop("controls/flight/flap-pos");
weight_lbs = getprop("fdm/jsbsim/inertia/weight-lbs") / 1000;
tow = getprop("FMGC/internal/tow");
lw = getprop("FMGC/internal/lw");
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
dest_wind = getprop("FMGC/internal/dest-wind");
flap = getprop("/controls/flight/flap-pos");
weight_lbs = getprop("/fdm/jsbsim/inertia/weight-lbs") / 1000;
tow = getprop("/FMGC/internal/tow");
lw = getprop("/FMGC/internal/lw");
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
dest_wind = getprop("/FMGC/internal/dest-wind");
# current appr speeds
clean = 2 * weight_lbs * 0.45359237 + 85;
@ -307,7 +307,7 @@ var masterFMGC = maketimer(0.2, func {
flap2 = vs1g_conf_2 * 1.47;
flap3 = vs1g_conf_3 * 1.36;
if (getprop("FMGC/internal/ldg-config-3-set")) {
if (getprop("/FMGC/internal/ldg-config-3-set")) {
vls = vs1g_conf_3 * 1.23;
} else {
vls = vs1g_conf_full * 1.23
@ -317,7 +317,7 @@ var masterFMGC = maketimer(0.2, func {
vls = 113;
}
if (!getprop("FMGC/internal/vapp-speed-set")) {
if (!getprop("/FMGC/internal/vapp-speed-set")) {
if (dest_wind < 5) {
vapp = vls + 5;
} else if (dest_wind > 15) {
@ -331,8 +331,8 @@ var masterFMGC = maketimer(0.2, func {
aoa_prot = 15;
aoa_max = 17.5;
aoa_0 = -5;
aoa = getprop("systems/navigation/adr/output/aoa-1");
cas = getprop("systems/navigation/adr/output/cas-1");
aoa = getprop("/systems/navigation/adr/output/aoa-1");
cas = getprop("/systems/navigation/adr/output/cas-1");
alpha_prot = cas * math.sqrt((aoa - aoa_0)/(aoa_prot - aoa_0));
alpha_max = cas * math.sqrt((aoa - aoa_0)/(aoa_max - aoa_0));
@ -361,7 +361,7 @@ var masterFMGC = maketimer(0.2, func {
slat_appr = vs1g_clean_appr * 1.23;
flap2_appr = vs1g_conf_2_appr * 1.47;
if (getprop("FMGC/internal/ldg-config-3-set")) {
if (getprop("/FMGC/internal/ldg-config-3-set")) {
vls_appr = vs1g_conf_3_appr * 1.23;
} else {
vls_appr = vs1g_conf_full_appr * 1.23
@ -371,7 +371,7 @@ var masterFMGC = maketimer(0.2, func {
vls_appr = 113;
}
if (!getprop("FMGC/internal/vapp-speed-set")) {
if (!getprop("/FMGC/internal/vapp-speed-set")) {
if (dest_wind < 5) {
vapp_appr = vls_appr + 5;
} else if (dest_wind > 15) {
@ -416,7 +416,7 @@ var masterFMGC = maketimer(0.2, func {
# Need info on these, also correct for height at altitude...
# https://www.pprune.org/archive/index.php/t-587639.html
if (getprop("FMGC/status/to-state") == 1) {
if (getprop("/FMGC/status/to-state") == 1) {
if (flap == 0) { # 0
setprop("FMGC/internal/computed-speeds/vls_min", vs1g_clean * 1.28);
} else if (flap == 1) { # 1
@ -479,31 +479,31 @@ var masterFMGC = maketimer(0.2, func {
departure_rwy = fmgc.flightPlanController.flightplans[2].departure_runway;
destination_rwy = fmgc.flightPlanController.flightplans[2].destination_runway;
if (destination_rwy != nil and phase >= 2) {
var airport = airportinfo(getprop("FMGC/internal/arr-arpt"));
var airport = airportinfo(getprop("/FMGC/internal/arr-arpt"));
setprop("FMGC/internal/ldg-elev", airport.elevation * M2FT); # eventually should be runway elevation
magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("environment/magnetic-variation-deg"));
magnetic_hdg = geo.normdeg(destination_rwy.heading - getprop("/environment/magnetic-variation-deg"));
runway_ils = destination_rwy.ils_frequency_mhz;
if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set") and !getprop("FMGC/internal/ils1crs-set")) {
if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) {
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
} else if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set")) {
} else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) {
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
} else if (!getprop("FMGC/internal/ils1crs-set")) {
} else if (!getprop("/FMGC/internal/ils1crs-set")) {
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
}
} else if (departure_rwy != nil and phase <= 1) {
magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("environment/magnetic-variation-deg"));
magnetic_hdg = geo.normdeg(departure_rwy.heading - getprop("/environment/magnetic-variation-deg"));
runway_ils = departure_rwy.ils_frequency_mhz;
if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set") and !getprop("FMGC/internal/ils1crs-set")) {
if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set") and !getprop("/FMGC/internal/ils1crs-set")) {
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
} else if (runway_ils != nil and !getprop("FMGC/internal/ils1freq-set")) {
} else if (runway_ils != nil and !getprop("/FMGC/internal/ils1freq-set")) {
setprop("FMGC/internal/ils1freq-calculated", runway_ils);
setprop("instrumentation/nav[0]/frequencies/selected-mhz", runway_ils);
} else if (!getprop("FMGC/internal/ils1crs-set")) {
} else if (!getprop("/FMGC/internal/ils1crs-set")) {
setprop("instrumentation/nav[0]/radials/selected-deg", magnetic_hdg);
}
}
@ -511,11 +511,11 @@ var masterFMGC = maketimer(0.2, func {
var reset_FMGC = func {
setprop("FMGC/status/phase", "0");
fd1 = getprop("it-autoflight/input/fd1");
fd2 = getprop("it-autoflight/input/fd2");
spd = getprop("it-autoflight/input/spd-kts");
hdg = getprop("it-autoflight/input/hdg");
alt = getprop("it-autoflight/input/alt");
fd1 = getprop("/it-autoflight/input/fd1");
fd2 = getprop("/it-autoflight/input/fd2");
spd = getprop("/it-autoflight/input/spd-kts");
hdg = getprop("/it-autoflight/input/hdg");
alt = getprop("/it-autoflight/input/alt");
ITAF.init();
FMGCinit();
flightPlanController.reset();
@ -535,7 +535,7 @@ var reset_FMGC = func {
setprop("systems/pressurization/outflowpos", "0");
setprop("systems/pressurization/deltap-norm", "0");
setprop("systems/pressurization/outflowpos-norm", "0");
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
setprop("systems/pressurization/cabinalt", altitude);
setprop("systems/pressurization/targetalt", altitude);
setprop("systems/pressurization/diff-to-target", "0");
@ -552,15 +552,15 @@ var reset_FMGC = func {
}
var various = maketimer(1, func {
if (getprop("engines/engine[0]/state") == 3 and getprop("engines/engine[1]/state") != 3) {
setprop("it-autoflight/settings/accel-agl-ft", getprop("FMGC/internal/eng-out-reduc"));
} else if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") == 3) {
setprop("it-autoflight/settings/accel-agl-ft", getprop("FMGC/internal/eng-out-reduc"));
if (getprop("/engines/engine[0]/state") == 3 and getprop("/engines/engine[1]/state") != 3) {
setprop("it-autoflight/settings/accel-agl-ft", getprop("/FMGC/internal/eng-out-reduc"));
} else if (getprop("/engines/engine[0]/state") != 3 and getprop("/engines/engine[1]/state") == 3) {
setprop("it-autoflight/settings/accel-agl-ft", getprop("/FMGC/internal/eng-out-reduc"));
} else {
setprop("it-autoflight/settings/accel-agl-ft", getprop("FMGC/internal/accel-agl-ft"));
setprop("it-autoflight/settings/accel-agl-ft", getprop("/FMGC/internal/accel-agl-ft"));
}
setprop("FMGC/internal/gw", math.round(getprop("fdm/jsbsim/inertia/weight-lbs"), 100));
setprop("FMGC/internal/gw", math.round(getprop("/fdm/jsbsim/inertia/weight-lbs"), 100));
});
var various2 = maketimer(0.5, func {
@ -573,9 +573,9 @@ var various2 = maketimer(0.5, func {
});
var nav0 = func {
var freqnav0uf = getprop("instrumentation/nav[0]/frequencies/selected-mhz");
var freqnav0uf = getprop("/instrumentation/nav[0]/frequencies/selected-mhz");
var freqnav0 = sprintf("%.2f", freqnav0uf);
var namenav0 = getprop("instrumentation/nav[0]/nav-id");
var namenav0 = getprop("/instrumentation/nav[0]/nav-id");
if (freqnav0 >= 108.10 and freqnav0 <= 111.95) {
if (namenav0 != "") {
setprop("FMGC/internal/ils1-mcdu", namenav0 ~ "/" ~ freqnav0);
@ -586,9 +586,9 @@ var nav0 = func {
}
var nav1 = func {
var freqnav1uf = getprop("instrumentation/nav[1]/frequencies/selected-mhz");
var freqnav1uf = getprop("/instrumentation/nav[1]/frequencies/selected-mhz");
var freqnav1 = sprintf("%.2f", freqnav1uf);
var namenav1 = getprop("instrumentation/nav[1]/nav-id");
var namenav1 = getprop("/instrumentation/nav[1]/nav-id");
if (freqnav1 >= 108.10 and freqnav1 <= 111.95) {
if (namenav1 != "") {
setprop("FMGC/internal/ils2-mcdu", freqnav1 ~ "/" ~ namenav1);
@ -599,9 +599,9 @@ var nav1 = func {
}
var nav2 = func {
var freqnav2uf = getprop("instrumentation/nav[2]/frequencies/selected-mhz");
var freqnav2uf = getprop("/instrumentation/nav[2]/frequencies/selected-mhz");
var freqnav2 = sprintf("%.2f", freqnav2uf);
var namenav2 = getprop("instrumentation/nav[2]/nav-id");
var namenav2 = getprop("/instrumentation/nav[2]/nav-id");
if (freqnav2 >= 108.00 and freqnav2 <= 117.95) {
if (namenav2 != "") {
setprop("FMGC/internal/vor1-mcdu", namenav2 ~ "/" ~ freqnav2);
@ -612,9 +612,9 @@ var nav2 = func {
}
var nav3 = func {
var freqnav3uf = getprop("instrumentation/nav[3]/frequencies/selected-mhz");
var freqnav3uf = getprop("/instrumentation/nav[3]/frequencies/selected-mhz");
var freqnav3 = sprintf("%.2f", freqnav3uf);
var namenav3 = getprop("instrumentation/nav[3]/nav-id");
var namenav3 = getprop("/instrumentation/nav[3]/nav-id");
if (freqnav3 >= 108.00 and freqnav3 <= 117.95) {
if (namenav3 != "") {
setprop("FMGC/internal/vor2-mcdu", freqnav3 ~ "/" ~ namenav3);
@ -625,9 +625,9 @@ var nav3 = func {
}
var adf0 = func {
var freqadf0uf = getprop("instrumentation/adf[0]/frequencies/selected-khz");
var freqadf0uf = getprop("/instrumentation/adf[0]/frequencies/selected-khz");
var freqadf0 = sprintf("%.2f", freqadf0uf);
var nameadf0 = getprop("instrumentation/adf[0]/ident");
var nameadf0 = getprop("/instrumentation/adf[0]/ident");
if (freqadf0 >= 190 and freqadf0 <= 1750) {
if (nameadf0 != "") {
setprop("FMGC/internal/adf1-mcdu", nameadf0 ~ "/" ~ freqadf0);
@ -638,9 +638,9 @@ var adf0 = func {
}
var adf1 = func {
var freqadf1uf = getprop("instrumentation/adf[1]/frequencies/selected-khz");
var freqadf1uf = getprop("/instrumentation/adf[1]/frequencies/selected-khz");
var freqadf1 = sprintf("%.2f", freqadf1uf);
var nameadf1 = getprop("instrumentation/adf[1]/ident");
var nameadf1 = getprop("/instrumentation/adf[1]/ident");
if (freqadf1 >= 190 and freqadf1 <= 1750) {
if (nameadf1 != "") {
setprop("FMGC/internal/adf2-mcdu", freqadf1 ~ "/" ~ nameadf1);
@ -655,30 +655,30 @@ var adf1 = func {
#################
var ManagedSPD = maketimer(0.25, func {
if (getprop("FMGC/internal/cruise-lvl-set") == 1 and getprop("FMGC/internal/cost-index-set") == 1) {
if (getprop("it-autoflight/input/spd-managed") == 1) {
altitude = getprop("instrumentation/altimeter/indicated-altitude-ft");
mode = getprop("modes/pfd/fma/pitch-mode");
ias = getprop("instrumentation/airspeed-indicator/indicated-speed-kt");
mach = getprop("instrumentation/airspeed-indicator/indicated-mach");
ktsmach = getprop("it-autoflight/input/kts-mach");
mngktsmach = getprop("FMGC/internal/mng-kts-mach");
mng_spd = getprop("FMGC/internal/mng-spd");
mng_spd_cmd = getprop("FMGC/internal/mng-spd-cmd");
kts_sel = getprop("it-autoflight/input/spd-kts");
mach_sel = getprop("it-autoflight/input/spd-mach");
srsSPD = getprop("it-autoflight/settings/togaspd");
phase = getprop("FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
flap = getprop("controls/flight/flap-pos");
maxspeed = getprop("FMGC/internal/maxspeed");
minspeed = getprop("FMGC/internal/minspeed");
mach_switchover = getprop("FMGC/internal/mach-switchover");
decel = getprop("FMGC/internal/decel");
if (getprop("/FMGC/internal/cruise-lvl-set") == 1 and getprop("/FMGC/internal/cost-index-set") == 1) {
if (getprop("/it-autoflight/input/spd-managed") == 1) {
altitude = getprop("/instrumentation/altimeter/indicated-altitude-ft");
mode = getprop("/modes/pfd/fma/pitch-mode");
ias = getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
mach = getprop("/instrumentation/airspeed-indicator/indicated-mach");
ktsmach = getprop("/it-autoflight/input/kts-mach");
mngktsmach = getprop("/FMGC/internal/mng-kts-mach");
mng_spd = getprop("/FMGC/internal/mng-spd");
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
kts_sel = getprop("/it-autoflight/input/spd-kts");
mach_sel = getprop("/it-autoflight/input/spd-mach");
srsSPD = getprop("/it-autoflight/settings/togaspd");
phase = getprop("/FMGC/status/phase"); # 0 is Preflight 1 is Takeoff 2 is Climb 3 is Cruise 4 is Descent 5 is Decel/Approach 6 is Go Around 7 is Done
flap = getprop("/controls/flight/flap-pos");
maxspeed = getprop("/FMGC/internal/maxspeed");
minspeed = getprop("/FMGC/internal/minspeed");
mach_switchover = getprop("/FMGC/internal/mach-switchover");
decel = getprop("/FMGC/internal/decel");
mng_alt_spd_cmd = getprop("FMGC/internal/mng-alt-spd");
mng_alt_spd_cmd = getprop("/FMGC/internal/mng-alt-spd");
mng_alt_spd = math.round(mng_alt_spd_cmd, 1);
mng_alt_mach_cmd = getprop("FMGC/internal/mng-alt-mach");
mng_alt_mach_cmd = getprop("/FMGC/internal/mng-alt-mach");
mng_alt_mach = math.round(mng_alt_mach_cmd, 0.001);
if (mach > mng_alt_mach and (phase == 2 or phase == 3)) {
@ -753,7 +753,7 @@ var ManagedSPD = maketimer(0.25, func {
}
}
mng_spd_cmd = getprop("FMGC/internal/mng-spd-cmd");
mng_spd_cmd = getprop("/FMGC/internal/mng-spd-cmd");
if (mng_spd_cmd > maxspeed -5) {
setprop("FMGC/internal/mng-spd", maxspeed -5);
@ -767,7 +767,7 @@ var ManagedSPD = maketimer(0.25, func {
setprop("it-autoflight/input/kts-mach", 1);
}
mng_spd = getprop("FMGC/internal/mng-spd");
mng_spd = getprop("/FMGC/internal/mng-spd");
if (kts_sel != mng_spd and !ktsmach) {
setprop("it-autoflight/input/spd-kts", mng_spd);
@ -784,10 +784,10 @@ var ManagedSPD = maketimer(0.25, func {
});
var switchDatabase = func {
database1 = getprop("FMGC/internal/navdatabase");
database2 = getprop("FMGC/internal/navdatabase2");
code1 = getprop("FMGC/internal/navdatabasecode");
code2 = getprop("FMGC/internal/navdatabasecode2");
database1 = getprop("/FMGC/internal/navdatabase");
database2 = getprop("/FMGC/internal/navdatabase2");
code1 = getprop("/FMGC/internal/navdatabasecode");
code2 = getprop("/FMGC/internal/navdatabasecode2");
setprop("FMGC/internal/navdatabase", database2);
setprop("FMGC/internal/navdatabase2", database1);
setprop("FMGC/internal/navdatabasecode", code2);
@ -796,12 +796,12 @@ var switchDatabase = func {
# Landing to phase 7
setlistener("gear/gear[1]/wow", func() {
if (getprop("gear/gear[1]/wow") == 0 and timer30secLanding.isRunning) {
if (getprop("/gear/gear[1]/wow") == 0 and timer30secLanding.isRunning) {
timer30secLanding.stop();
setprop("FMGC/internal/landing-time", -99);
}
if (getprop("gear/gear[1]/wow") == 1 and getprop("FMGC/internal/landing-time") == -99) {
if (getprop("/gear/gear[1]/wow") == 1 and getprop("/FMGC/internal/landing-time") == -99) {
timer30secLanding.start();
setprop("FMGC/internal/landing-time", pts.Sim.Time.elapsedSec.getValue());
}
@ -813,7 +813,7 @@ setlistener("systems/navigation/adr/operating-1", func() {
timer48gpsAlign1.stop();
}
if (getprop("FMGC/internal/align1-time") == -99) {
if (getprop("/FMGC/internal/align1-time") == -99) {
timer48gpsAlign1.start();
setprop("FMGC/internal/align1-time", pts.Sim.Time.elapsedSec.getValue());
}
@ -825,7 +825,7 @@ setlistener("systems/navigation/adr/operating-2", func() {
timer48gpsAlign2.stop();
}
if (getprop("FMGC/internal/align2-time") == -99) {
if (getprop("/FMGC/internal/align2-time") == -99) {
timer48gpsAlign2.start();
setprop("FMGC/internal/align2-time", pts.Sim.Time.elapsedSec.getValue());
}
@ -837,7 +837,7 @@ setlistener("systems/navigation/adr/operating-3", func() {
timer48gpsAlign3.stop();
}
if (getprop("FMGC/internal/align3-time") == -99) {
if (getprop("/FMGC/internal/align3-time") == -99) {
timer48gpsAlign3.start();
setprop("FMGC/internal/align3-time", pts.Sim.Time.elapsedSec.getValue());
}
@ -846,7 +846,7 @@ setlistener("systems/navigation/adr/operating-3", func() {
# Maketimers
var timer30secLanding = maketimer(1, func() {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/landing-time") + 30) {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/landing-time") + 30) {
setprop("FMGC/status/phase", 7);
setprop("FMGC/internal/landing-time", -99);
timer30secLanding.stop();
@ -854,7 +854,7 @@ var timer30secLanding = maketimer(1, func() {
});
var timer48gpsAlign1 = maketimer(1, func() {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/align1-time") + 48) {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align1-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) {
setprop("FMGC/internal/align1-done", 1);
setprop("FMGC/internal/align1-time", -99);
timer48gpsAlign1.stop();
@ -862,7 +862,7 @@ var timer48gpsAlign1 = maketimer(1, func() {
});
var timer48gpsAlign2 = maketimer(1, func() {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/align2-time") + 48) {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align2-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) {
setprop("FMGC/internal/align2-done", 1);
setprop("FMGC/internal/align2-time", -99);
timer48gpsAlign2.stop();
@ -870,7 +870,7 @@ var timer48gpsAlign2 = maketimer(1, func() {
});
var timer48gpsAlign3 = maketimer(1, func() {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("FMGC/internal/align3-time") + 48) {
if (pts.Sim.Time.elapsedSec.getValue() > getprop("/FMGC/internal/align3-time") + 48 or getprop("/systems/acconfig/options/adirs-skip")) {
setprop("FMGC/internal/align3-done", 1);
setprop("FMGC/internal/align3-time", -99);
timer48gpsAlign3.stop();

View file

@ -525,7 +525,7 @@ var flightPlanController = {
if (text == "CLR") {
return me.deleteWP(index, thePlan, 0);
} elsif (size(text) == 16) {
} elsif (size(text) > 12) {
return me.insertLatLonFix(text, index, thePlan);
} elsif (size(text) == 5) {
return me.insertFix(text, index, thePlan);

View file

@ -3,6 +3,19 @@
# Copyright (c) 2020 Josh Davidson (Octal450)
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);
@ -60,23 +73,10 @@ var variousReset = func {
}
var BUTTONS = {
init: func() {
var stateL = getprop("engines/engine[0]/state");
var stateR = getprop("engines/engine[1]/state");
var Lrain = getprop("controls/switches/LrainRpt");
var Rrain = getprop("controls/switches/RrainRpt");
var OnLt = getprop("controls/switches/emerCallLtO");
var CallLt = getprop("controls/switches/emerCallLtC");
var EmerCall = getprop("controls/switches/emerCall");
var wow = getprop("gear/gear[1]/wow");
var wowr = getprop("gear/gear[2]/wow");
var gndCtl = getprop("systems/CVR/gndctl");
var acPwr = getprop("systems/electrical/bus/ac-ess");
},
update: func() {
rainRepel();
CVR_master();
if (getprop("controls/switches/emerCall")) {
if (EmerCall.getValue()) {
EmerCallOnLight();
EmerCallLight();
}
@ -84,88 +84,86 @@ var BUTTONS = {
};
var rainRepel = func() {
Lrain = getprop("controls/switches/LrainRpt");
Rrain = getprop("controls/switches/RrainRpt");
wow = getprop("gear/gear[1]/wow");
stateL = getprop("engines/engine[0]/state");
stateR = getprop("engines/engine[1]/state");
if (Lrain and (stateL != 3 and stateR != 3 and wow)) {
setprop("controls/switches/LrainRpt", 0);
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 and (stateL != 3 and stateR != 3 and wow)) {
setprop("controls/switches/RrainRpt", 0);
if (Rrain.getValue()) {
Rrain.setValue(0);
}
}
}
var _OnLt = nil;
var _EmerCall = nil;
var EmerCallOnLight = func() {
OnLt = getprop("controls/switches/emerCallLtO");
EmerCall = getprop("controls/switches/emerCall");
if ((OnLt and EmerCall) or !EmerCall) {
setprop("controls/switches/emerCallLtO", 0);
} else if (!OnLt and EmerCall) {
setprop("controls/switches/emerCallLtO", 1);
_OnLt = OnLt.getValue();
_EmerCall = EmerCall.getValue();
if ((_OnLt and _EmerCall) or !_EmerCall) {
OnLt.setValue(0);
} else if (!_OnLt and _EmerCall) {
OnLt.setValue(1);
}
}
var _CallLt = nil;
var _EmerCall2 = nil;
var EmerCallLight = func() {
CallLt = getprop("controls/switches/emerCallLtC");
EmerCall = getprop("controls/switches/emerCall");
if ((CallLt and EmerCall) or !EmerCall) {
setprop("controls/switches/emerCallLtC", 0);
} else if (!CallLt and EmerCall) {
setprop("controls/switches/emerCallLtC", 1);
_CallLt = CallLt.getValue();
_EmerCall2 = EmerCall.getValue();
if ((_CallLt and _EmerCall2) or !_EmerCall2) {
CallLt.setValue(0);
} else if (!_CallLt and _EmerCall2) {
CallLt.setValue(1);
}
}
var CVR_master = func() {
stateL = getprop("engines/engine[0]/state");
stateR = getprop("engines/engine[1]/state");
wow = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
gndCtl = getprop("systems/CVR/gndctl");
acPwr = getprop("systems/electrical/bus/ac-ess");
if (acPwr > 0 and wow and wowr and (gndCtl or (stateL == 3 or stateR == 3))) {
setprop("controls/CVR/power", 1);
} else if (!wow and !wowr and acPwr > 0) {
setprop("controls/CVR/power", 1);
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 {
setprop("controls/CVR/power", 0);
cvr_power.setValue(0);
}
}
var EmerCall = func {
setprop("controls/switches/emerCall", 1);
var EmerCallFunc = func {
EmerCall.setValue(1);
settimer(func() {
setprop("controls/switches/emerCall", 0);
EmerCall.setValue(0);
}, 10);
}
var CabinCall = func {
setprop("controls/switches/cabinCall", 0);
var CabinCallFunc = func {
CabinCall.setValue(1);
settimer(func() {
setprop("controls/switches/cabinCall", 0);
CabinCall.setValue(0);
}, 15);
}
var MechCall = func {
setprop("controls/switches/mechCall", 1);
var MechCallFunc = func {
MechCall.setValue(1);
settimer(func() {
setprop("controls/switches/mechCall", 0);
MechCall.setValue(0);
}, 15);
}
var CVR_test = func {
var parkBrake = getprop("controls/gear/brake-parking");
if (parkBrake) {
setprop("controls/CVR/tone", 1);
if (pts.Controls.Gear.parkingBrake.getValue()) {
cvr_tone.setValue(1);
settimer(func() {
setprop("controls/CVR/tone", 0);
cvr_tone.setValue(0);
}, 15);
}
}
setlistener("/controls/apu/master", func() { # poor mans set-reset latch
if (!getprop("controls/apu/master") and (systems.APUController.APU.signals.emer or systems.APUController.APU.signals.autoshutdown)) {
if (!systems.APUNodes.Controls.master.getValue() and (systems.APUController.APU.signals.emer or systems.APUController.APU.signals.autoshutdown)) {
systems.APUController.APU.signals.emer = 0;
systems.APUController.APU.signals.autoshutdown = 0;
}

View file

@ -201,7 +201,6 @@ var systemsInit = func {
systems.HYD.init();
systems.FUEL.init();
systems.ADIRS.init();
systems.ADIRSnew.init();
systems.eng_init();
systems.APUController.init();
systems.fire_init();
@ -216,7 +215,6 @@ var systemsInit = func {
icing.icingInit();
lightsLoop.start();
libraries.ECAM.init();
libraries.BUTTONS.init();
libraries.variousReset();
rmp.init();
acp.init();
@ -236,7 +234,7 @@ var systemsLoop = maketimer(0.1, func {
systems.PNEU.loop();
systems.HYD.loop();
systems.FUEL.loop();
systems.ADIRSnew.loop();
systems.ADIRS.loop();
libraries.ECAM.loop();
libraries.BUTTONS.update();
fadec.FADEC.loop();

View file

@ -29,6 +29,7 @@ var Controls = {
},
Gear: {
gearDown: props.globals.getNode("/controls/gear/gear-down"),
parkingBrake: props.globals.getNode("/controls/gear/brake-parking"),
},
};
@ -77,6 +78,7 @@ 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")],
};
var Instrumentation = {

View file

@ -4,20 +4,18 @@
var shakeEffectA3XX = props.globals.initNode("/systems/shake/effect", 0, "BOOL");
var shakeA3XX = props.globals.initNode("/systems/shake/shaking", 0, "DOUBLE");
var rSpeed = 0;
var sf = 0;
var n_g_c = 0;
var n_g_l = 0;
var n_g_r = 0;
var theShakeEffect = func {
n_g_c = getprop("gear/gear[0]/compression-norm") or 0;
n_g_l = getprop("gear/gear[1]/compression-norm") or 0;
n_g_r = getprop("gear/gear[2]/compression-norm") or 0;
rSpeed = getprop("gear/gear[0]/rollspeed-ms") or 0;
sf = rSpeed / 94000;
n_g_c = pts.Gear.compression[0].getValue() or 0;
n_g_l = pts.Gear.compression[1].getValue() or 0;
n_g_r = pts.Gear.compression[2].getValue() or 0;
if (shakeEffectA3XX.getBoolValue() and (n_g_c > 0 or n_g_l > 0 or n_g_r > 0)) {
sf = pts.Gear.rollspeed[0].getValue() / 94000;
interpolate("/systems/shake/shaking", sf, 0.03);
settimer(func {
interpolate("/systems/shake/shaking", -sf * 2, 0.03);
@ -27,13 +25,13 @@ var theShakeEffect = func {
}, 0.12);
settimer(theShakeEffect, 0.09);
} else {
setprop("systems/shake/shaking", 0);
setprop("systems/shake/effect", 0);
shakeA3XX.setValue(0);
shakeEffectA3XX.setBoolValue(0);
}
}
setlistener("/systems/shake/effect", func(state) {
if(state.getBoolValue()) {
setlistener("/systems/shake/effect", func {
if (shakeEffectA3XX.getBoolValue()) {
theShakeEffect();
}
}, 1, 0);
}, 0, 0);

View file

@ -1,4 +1,4 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)

View file

@ -1,6 +1,6 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
# From INIT-B
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);

View file

@ -1,7 +1,7 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var initInputA = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,6 +1,6 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var zfwcg = props.globals.getNode("FMGC/internal/zfwcg", 1);
var zfwcgSet = props.globals.getNode("FMGC/internal/zfwcg-set", 1);

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var initInputIRS = func(key, i) {
if (key == "up") {

View file

@ -158,17 +158,15 @@ var dmsToString = func(dms, type) {
var stringToDegrees = func(string, type) {
if (type == "lat") {
var degrees = left(string, 2);
var minutesStr = right(string, 5);
} else {
var degrees = left(string, 3);
var minutesStr = right(string, 5);
}
var splitString = split(".", string);
var minutes = left(minutesStr, 4);
var sign = right(minutesStr, 1);
var decimal = degrees + (minutes / 60);
var degrees = left(splitString[0], size(splitString[0]) - 2);
var minutes = right(splitString[0], 2);
var secondsSign = splitString[1];
var minutesStr = minutes + (left(secondsSign, 1) / 10);
var sign = right(secondsSign, 1);
var decimal = degrees + (minutesStr / 60);
if (type == "lat") {
if (sign == "N") {
return decimal;

View file

@ -1,7 +1,7 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var MCDU_init = func(i) {
MCDU_reset(i); # Reset MCDU, clears data
@ -118,7 +118,7 @@ var MCDU_reset = func(i) {
setprop("FMGC/internal/pri-efob", 0);
setprop("FMGC/internal/alt-efob", 0);
setprop("FMGC/internal/fob", 0);
setprop("FMGC/internal/gw", 0);
setprop("FMGC/internal/fuel-pred-gw", 0);
setprop("FMGC/internal/cg", 0);
# PROG

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
# APPR PERF
var ldg_config_3_set = props.globals.getNode("/FMGC/internal/ldg-config-3-set", 1);

View file

@ -1,6 +1,6 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var perfCLBInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,6 +1,6 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var perfCRZInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,6 +1,6 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var perfDESInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
# uses universal values, will implement separately once FPLN is finished

View file

@ -1,7 +1,7 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var perfTOInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progCLBInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progCRZInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progDESInput = func(key, i) {
var scratchpad = getprop("MCDU[" ~ i ~ "]/scratchpad");

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var altSet = props.globals.getNode("it-autoflight/input/alt", 1);

View file

@ -1,4 +1,4 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)

View file

@ -1,4 +1,4 @@
# Copyright (c) 2020 Matthew Maring (hayden2000)
# Copyright (c) 2020 Matthew Maring (mattmaring)
var initInputROUTESEL = func(key, i) {
if (key == "L6") {

View file

@ -1,4 +1,4 @@
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (hayden2000)
# A3XX mCDU by Joshua Davidson (Octal450), Jonathan Redpath, and Matthew Maring (mattmaring)
# Copyright (c) 2020 Josh Davidson (Octal450)

View file

@ -1,19 +0,0 @@
# A3XX ADIRS System
# Joshua Davidson (Octal450)
# Copyright (c) 2020 Josh Davidson (Octal450)
var ADIRS = {
init: func() {
setprop("controls/adirs/mcdu/mode1", ""); # INVAL ALIGN NAV ATT or off (blank)
setprop("controls/adirs/mcdu/mode2", "");
setprop("controls/adirs/mcdu/mode3", "");
setprop("controls/adirs/mcdu/status1", ""); # see smith thales p487
setprop("controls/adirs/mcdu/status2", "");
setprop("controls/adirs/mcdu/status3", "");
setprop("controls/adirs/mcdu/hdg", ""); # only shown if in ATT mode
setprop("controls/adirs/mcdu/avgdrift1", "");
setprop("controls/adirs/mcdu/avgdrift2", "");
setprop("controls/adirs/mcdu/avgdrift3", "");
setprop("controls/adirs/mcducbtn", 0);
},
};

View file

@ -22,7 +22,7 @@ var ADIRU = {
num: 0,
aligned: 0,
inAlign: 0,
outputOn: 0, # 0 = disc, 1 = normal
outputOn: 1, # 0 = disc, 1 = normal
mode: 0, # 0 = off, 1 = nav, 2 = att
energised: 0, # 0 = off, 1 = on
operative: 0, # 0 = off,
@ -61,34 +61,34 @@ var ADIRU = {
},
# BITE
selfTest: func() {
ADIRSnew._selfTest = 1;
ADIRS._selfTest = 1;
_selfTestTime = pts.Sim.Time.elapsedSec.getValue();
ADIRSnew.Lights.adrOff[me.num].setValue(1);
ADIRSnew.Lights.adrFault[me.num].setValue(1);
ADIRS.Lights.adrOff[me.num].setValue(1);
ADIRS.Lights.adrFault[me.num].setValue(1);
settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(0);
ADIRSnew.Lights.adrFault[me.num].setValue(0);
ADIRS.Lights.adrOff[me.num].setValue(0);
ADIRS.Lights.adrFault[me.num].setValue(0);
}, 0.1);
settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(1);
ADIRSnew.Lights.adrFault[me.num].setValue(1);
ADIRSnew.Lights.irFault[me.num].setValue(1);
ADIRSnew.Lights.irOff[me.num].setValue(1);
ADIRS.Lights.adrOff[me.num].setValue(1);
ADIRS.Lights.adrFault[me.num].setValue(1);
ADIRS.Lights.irFault[me.num].setValue(1);
ADIRS.Lights.irOff[me.num].setValue(1);
}, 1.0);
settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(0);
ADIRSnew.Lights.adrFault[me.num].setValue(0);
ADIRSnew.Lights.irFault[me.num].setValue(0);
ADIRSnew.Lights.irOff[me.num].setValue(0);
ADIRS.Lights.adrOff[me.num].setValue(!ADIRS.Switches.adrSw[me.num].getValue());
ADIRS.Lights.adrFault[me.num].setValue(0);
ADIRS.Lights.irFault[me.num].setValue(0);
ADIRS.Lights.irOff[me.num].setValue(0);
}, 1.1);
ADIRSnew.selfTest();
ADIRS.selfTest();
},
# Alignment
align: func(time) {
ADIRSnew.Lights.irFault[me.num].setBoolValue(0);
if (!ADIRSnew.skip.getValue()) {
ADIRS.Lights.irFault[me.num].setBoolValue(0);
if (!ADIRS.skip.getValue()) {
if (time > 0 and me.aligned == 0 and me.inAlign == 0 and me.operative == 1) {
me._alignTime = pts.Sim.Time.elapsedSec.getValue() + time;
me.inAlign = 1;
@ -110,7 +110,7 @@ var ADIRU = {
print("Stopping alignment or setting unaligned state");
me.inAlign = 0;
me.aligned = 0;
setprop("systems/navigation/aligned-" ~ (me.num + 1), 0);
ADIRS.Operating.aligned[me.num].setValue(0);
if (me.alignTimer != nil) {
me.alignTimer.stop();
}
@ -118,7 +118,7 @@ var ADIRU = {
stopAlignAligned: func() {
me.inAlign = 0;
me.aligned = 1;
setprop("systems/navigation/aligned-" ~ (me.num + 1), 1);
ADIRS.Operating.aligned[me.num].setValue(1);
if (me.alignTimer != nil) {
me.alignTimer.stop();
}
@ -154,26 +154,26 @@ var ADIRU = {
if (me._voltageMain) {
me._noPowerTime = 0;
me.setOperative(1);
if (!ADIRSnew._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0);
if (!ADIRS._selfTest) {
ADIRS.Lights.onBat.setBoolValue(0);
}
} elsif (((me._timeVar < me._noPowerTime + 300 and me._voltageLimitedTime) or !me._voltageLimitedTime) and me._voltageBackup) {
me.setOperative(1);
if (!ADIRSnew._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(1);
if (!ADIRS._selfTest) {
ADIRS.Lights.onBat.setBoolValue(1);
}
} else {
me._noPowerTime = 0;
me.setOperative(0);
if (!ADIRSnew._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0);
if (!ADIRS._selfTest) {
ADIRS.Lights.onBat.setBoolValue(0);
}
}
} else {
me._noPowerTime = 0;
me.setOperative(0);
if (!ADIRSnew._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0);
if (!ADIRS._selfTest) {
ADIRS.Lights.onBat.setBoolValue(0);
}
}
},
@ -182,49 +182,49 @@ var ADIRU = {
var ADIRSControlPanel = {
adrSw: func(n) {
if (n < 0 or n > _NUMADIRU) { return; }
ADIRSnew._adrSwitchState = ADIRSnew.Switches.adrSw[n].getValue();
ADIRSnew.Switches.adrSw[n].setValue(!ADIRSnew._adrSwitchState);
if (ADIRSnew.ADIRunits[n] != nil) {
ADIRSnew.ADIRunits[n].outputOn = !ADIRSnew._adrSwitchState;
ADIRS._adrSwitchState = ADIRS.Switches.adrSw[n].getValue();
ADIRS.Switches.adrSw[n].setValue(!ADIRS._adrSwitchState);
if (ADIRS.ADIRunits[n] != nil) {
ADIRS.ADIRunits[n].outputOn = !ADIRS._adrSwitchState;
}
ADIRSnew.Lights.adrOff[n].setValue(ADIRSnew._adrSwitchState);
ADIRS.Lights.adrOff[n].setValue(ADIRS._adrSwitchState);
},
irSw: func(n) {
if (n < 0 or n > _NUMADIRU) { return; }
ADIRSnew._irSwitchState = ADIRSnew.Switches.irSw[n].getValue();
ADIRSnew.Switches.irSw[n].setValue(!ADIRSnew._irSwitchState);
if (ADIRSnew.IRunits[n] != nil) {
ADIRSnew.IRunits[n].outputOn = !ADIRSnew._irSwitchState;
ADIRS._irSwitchState = ADIRS.Switches.irSw[n].getValue();
ADIRS.Switches.irSw[n].setValue(!ADIRS._irSwitchState);
if (ADIRS.IRunits[n] != nil) {
ADIRS.IRunits[n].outputOn = !ADIRS._irSwitchState;
}
ADIRSnew.Lights.irOff[n].setValue(ADIRSnew._adrSwitchState);
ADIRS.Lights.irOff[n].setValue(ADIRS._adrSwitchState);
},
irModeSw: func(n, mode) {
if (n < 0 or n > _NUMADIRU) { return; }
if (mode < 0 or mode > 2) { return; }
me._irModeSwitchState = ADIRSnew.Switches.irModeSw[n].getValue();
if (ADIRSnew.ADIRunits[n] != nil) {
ADIRSnew.ADIRunits[n].mode = mode;
ADIRSnew.ADIRunits[n].updateEnergised(mode);
ADIRSnew.Switches.irModeSw[n].setValue(mode);
me._irModeSwitchState = ADIRS.Switches.irModeSw[n].getValue();
if (ADIRS.ADIRunits[n] != nil) {
ADIRS.ADIRunits[n].mode = mode;
ADIRS.ADIRunits[n].updateEnergised(mode);
ADIRS.Switches.irModeSw[n].setValue(mode);
if (mode == 0) {
ADIRSnew.Lights.irFault[n].setBoolValue(0);
ADIRSnew.ADIRunits[n].stopAlignNoAlign();
} elsif (ADIRSnew.ADIRunits[n].aligned == 0) {
ADIRSnew.ADIRunits[n].update(); # update early so operative is set properly
ADIRSnew.ADIRunits[n].align(calcAlignTime(pts.Position.latitude.getValue())); # when you set NAV, it first acquires GPS position then acquires GPS. You then use IRS INIT > to set PPOS to align if you wish
ADIRS.Lights.irFault[n].setBoolValue(0);
ADIRS.ADIRunits[n].stopAlignNoAlign();
} elsif (ADIRS.ADIRunits[n].aligned == 0) {
ADIRS.ADIRunits[n].update(); # update early so operative is set properly
ADIRS.ADIRunits[n].align(calcAlignTime(pts.Position.latitude.getValue())); # when you set NAV, it first acquires GPS position then acquires GPS. You then use IRS INIT > to set PPOS to align if you wish
}
}
}
};
var ADIRSnew = {
var ADIRS = {
# local vars
_adrSwitchState: 0,
_irSwitchState: 0,
_irModeSwitchState: 0,
_hasPower: 0,
_cacheOperative: [0, 0, 0],
_cacheOutputOn: [0, 0, 0],
_cacheOutputOn: [1, 1, 1],
_flapPos: nil,
_slatPos: nil,
_selfTest: 0,
@ -235,23 +235,25 @@ var ADIRSnew = {
# Electrical
mainSupply: [systems.ELEC.Bus.acEss, systems.ELEC.Bus.ac2, systems.ELEC.Bus.ac1],
backupSupply: [[systems.ELEC.Bus.dcHot2, 0], [systems.ELEC.Bus.dcHot2, 1], [systems.ELEC.Bus.dcHot1, 1]],
backupSupply: [[systems.ELEC.Source.Bat2.volt, 0], [systems.ELEC.Source.Bat2.volt, 1], [systems.ELEC.Source.Bat1.volt, 1]],
# ADIRS power directly from a separate bus connected to battery (no c.b. unlike main hot bus), as they are so critical
# PTS
Lights: {
adrFault: [props.globals.getNode("controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("controls/navigation/adirscp/lights/adr-3-fault")],
adrOff: [props.globals.getNode("controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("controls/navigation/adirscp/lights/adr-3-off")],
irFault: [props.globals.getNode("controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("controls/navigation/adirscp/lights/ir-3-fault")],
irOff: [props.globals.getNode("controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("controls/navigation/adirscp/lights/ir-3-off")],
onBat: props.globals.getNode("controls/navigation/adirscp/lights/on-bat"),
adrFault: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-fault")],
adrOff: [props.globals.getNode("/controls/navigation/adirscp/lights/adr-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/adr-3-off")],
irFault: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-fault"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-fault")],
irOff: [props.globals.getNode("/controls/navigation/adirscp/lights/ir-1-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-2-off"), props.globals.getNode("/controls/navigation/adirscp/lights/ir-3-off")],
onBat: props.globals.getNode("/controls/navigation/adirscp/lights/on-bat"),
},
Switches: {
adrSw: [props.globals.getNode("controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("controls/navigation/adirscp/switches/adr-3")],
irModeSw: [props.globals.getNode("controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("controls/navigation/adirscp/switches/ir-3-mode")],
irSw: [props.globals.getNode("controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("controls/navigation/adirscp/switches/ir-3")],
adrSw: [props.globals.getNode("/controls/navigation/adirscp/switches/adr-1"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-2"), props.globals.getNode("/controls/navigation/adirscp/switches/adr-3")],
irModeSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2-mode"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3-mode")],
irSw: [props.globals.getNode("/controls/navigation/adirscp/switches/ir-1"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-2"), props.globals.getNode("/controls/navigation/adirscp/switches/ir-3")],
},
Operating: {
adr: [props.globals.getNode("systems/navigation/adr/operating-1"), props.globals.getNode("systems/navigation/adr/operating-2"), props.globals.getNode("systems/navigation/adr/operating-3")],
adr: [props.globals.getNode("/systems/navigation/adr/operating-1"), props.globals.getNode("/systems/navigation/adr/operating-2"), props.globals.getNode("/systems/navigation/adr/operating-3")],
aligned: [props.globals.getNode("/systems/navigation/aligned-1"), props.globals.getNode("/systems/navigation/aligned-2"), props.globals.getNode("/systems/navigation/aligned-3")],
},
# Nodes
@ -275,17 +277,17 @@ var ADIRSnew = {
me._slatPos = pts.Fdm.JSBsim.Fcs.slatDeg.getValue();
if (me._flapPos >= 23 and me._slatPos >= 25) {
ADIRSnew.overspeedVFE.setValue(181);
ADIRS.overspeedVFE.setValue(181);
} elsif (me._flapPos >= 18) {
ADIRSnew.overspeedVFE.setValue(189);
ADIRS.overspeedVFE.setValue(189);
} elsif (me._flapPos >= 13 or me._slatPos > 20) {
ADIRSnew.overspeedVFE.setValue(204);
ADIRS.overspeedVFE.setValue(204);
} elsif (me._slatPos <= 20 and me._flapPos > 2) {
ADIRSnew.overspeedVFE.setValue(219);
ADIRS.overspeedVFE.setValue(219);
} elsif (me._slatPos >= 2 and me._slatPos <= 20) {
ADIRSnew.overspeedVFE.setValue(234);
ADIRS.overspeedVFE.setValue(234);
} else {
ADIRSnew.overspeedVFE.setValue(1024);
ADIRS.overspeedVFE.setValue(1024);
}
}
),
@ -321,7 +323,7 @@ var ADIRSnew = {
}
},
selfTest: func() {
ADIRSnew.Lights.onBat.setBoolValue(1);
ADIRS.Lights.onBat.setBoolValue(1);
selfTestLoop.start();
},
@ -338,10 +340,10 @@ setlistener("/systems/fmgc/cas-compare/cas-reject-all", func() {
}, 0, 0);
setlistener("/controls/adirs/skip", func() {
if (ADIRSnew.skip.getBoolValue()) {
if (ADIRS.skip.getBoolValue()) {
for (i = 0; i < 3; i = i + 1) {
if (ADIRSnew.ADIRunits[i].inAlign == 1) {
ADIRSnew.ADIRunits[i].stopAlignAligned();
if (ADIRS.ADIRunits[i].inAlign == 1) {
ADIRS.ADIRunits[i].stopAlignAligned();
}
}
}
@ -349,8 +351,8 @@ setlistener("/controls/adirs/skip", func() {
selfTestLoop = maketimer(0.2, func() {
if (pts.Sim.Time.elapsedSec.getValue() > _selfTestTime + 5) {
ADIRSnew.Lights.onBat.setBoolValue(0);
ADIRS.Lights.onBat.setBoolValue(0);
selfTestLoop.stop();
ADIRSnew._selfTest = 0;
ADIRS._selfTest = 0;
}
});

View file

@ -79,14 +79,16 @@ var ELEC = {
},
Source: {
Bat1: {
amps: props.globals.getNode("systems/electrical/sources/bat-1/amp"),
limiter: props.globals.getNode("systems/electrical/sources/bat-1/limiter"),
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"),
},
Bat2: {
amps: props.globals.getNode("systems/electrical/sources/bat-2/amp"),
limiter: props.globals.getNode("systems/electrical/sources/bat-2/limiter"),
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"),
},
@ -159,74 +161,6 @@ var ELEC = {
me.Fail.tr2Fault.setBoolValue(0);
},
loop: func() {
battery1_sw = me.Switch.bat1.getValue();
battery2_sw = me.Switch.bat2.getValue();
batt1_fail = me.Fail.bat1Fault.getValue();
batt2_fail = me.Fail.bat2Fault.getValue();
battery1_percent = me.Source.Bat1.percent.getValue();
battery2_percent = me.Source.Bat2.percent.getValue();
battery1_amps = me.Source.Bat1.amps.getValue();
battery2_amps = me.Source.Bat2.amps.getValue();
battery1_time = me.Source.Bat1.time.getValue();
battery2_time = me.Source.Bat2.time.getValue();
dcbat = me.Bus.dcBat.getValue();
if (battery1_percent < 100 and dcbat > 25 and battery1_sw and !batt1_fail) {
if (battery1_time + 5 < getprop("sim/time/elapsed-sec")) {
battery1_percent_calc = battery1_percent + 0.75; # Roughly 90 percent every 10 mins
if (battery1_percent_calc > 100) {
battery1_percent_calc = 100;
}
me.Source.Bat1.limiter.setBoolValue(1);
me.Source.Bat1.percent.setValue(battery1_percent_calc);
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
}
} else if (battery1_percent == 100 and dcbat > 25 and battery1_sw and !batt1_fail) {
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
me.Source.Bat1.limiter.setBoolValue(0);
} else if (battery1_amps > 0 and battery1_sw and !batt1_fail) {
if (battery1_time + 5 < getprop("sim/time/elapsed-sec")) {
battery1_percent_calc = battery1_percent - 0.25; # Roughly 90 percent every 30 mins
if (battery1_percent_calc < 5) {
battery1_percent_calc = 5;
}
me.Source.Bat1.limiter.setBoolValue(1);
me.Source.Bat1.percent.setValue(battery1_percent_calc);
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
}
} else {
me.Source.Bat1.time.setValue(getprop("sim/time/elapsed-sec"));
me.Source.Bat1.limiter.setBoolValue(0);
}
if (battery2_percent < 100 and dcbat > 25 and battery2_sw and !batt2_fail) {
if (battery2_time + 5 < getprop("sim/time/elapsed-sec")) {
battery2_percent_calc = battery2_percent + 0.75; # Roughly 90 percent every 10 mins
if (battery2_percent_calc > 100) {
battery2_percent_calc = 100;
}
me.Source.Bat2.limiter.setBoolValue(1);
me.Source.Bat2.percent.setValue(battery2_percent_calc);
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
}
} else if (battery2_percent == 100 and dcbat > 25 and battery2_sw and !batt2_fail) {
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
me.Source.Bat2.limiter.setBoolValue(0);
} else if (battery2_amps > 0 and battery2_sw and !batt1_fail) {
if (battery2_time + 5 < getprop("sim/time/elapsed-sec")) {
battery2_percent_calc = battery2_percent - 0.25; # Roughly 90 percent every 30 mins
if (battery2_percent_calc < 5) {
battery2_percent_calc = 5;
}
me.Source.Bat2.limiter.setBoolValue(1);
me.Source.Bat2.percent.setValue(battery2_percent_calc);
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
}
} else {
me.Source.Bat2.time.setValue(getprop("sim/time/elapsed-sec"));
me.Source.Bat2.limiter.setBoolValue(0);
}
# Autopilot Disconnection routines
if (me.Bus.dcEssShed.getValue() < 25) {
if (getprop("it-autoflight/output/ap1") == 1 and !me._timer1On) {

View file

@ -44,7 +44,10 @@ var default = [
"/instrumentation/efis[1]/input/lh-vor-adf",
"/instrumentation/efis[1]/input/rh-vor-adf",
# parking brake
"/controls/gear/brake-parking"
"/controls/gear/brake-parking",
# electrics
"/systems/electrical/sources/bat-1/percent-calc",
"/systems/electrical/sources/bat-2/percent-calc"
];
var save = func (saved_props, file) {

View file

@ -2,8 +2,8 @@
A very advanced simulation of the Airbus A320 Family for FlightGear.
- Flight Dyanmics: Josh Davidson (Octal450)</label>
- Systems: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (hayden2000)</label>
- Displays: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (hayden2000)</label>
- Systems: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (mattmaring)</label>
- Displays: Josh Davidson (Octal450), Jonathan Redpath (legoboyvdlp), merspieler, Matthew Maring (mattmaring)</label>
- 3D/Textures: Thorsten Herrmann (TH-555), Semir Gebran (CaptB)</label>
Present pack includes the following Airbus A320 Family variants:

View file

@ -68,7 +68,7 @@
</or>
</condition>
<volume>
<factor>8</factor>
<value>0.8</value>
</volume>
<reference-dist>20.0</reference-dist>
<max-dist>100.0</max-dist>
@ -85,7 +85,7 @@
</equals>
</condition>
<volume>
<factor>8</factor>
<value>0.8</value>
</volume>
<reference-dist>20.0</reference-dist>
<max-dist>100.0</max-dist>
@ -1563,12 +1563,7 @@
<name>RelayBatt1</name>
<mode>once</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/relay-battery.wav</path>
<condition>
<greater-than>
<property>/systems/electrical/battery1-amps</property>
<value>25</value>
</greater-than>
</condition>
<property>/systems/electrical/sources/bat-1/contact</property>
<volume>
<factor>0.8</factor>
</volume>
@ -1578,12 +1573,7 @@
<name>RelayBatt2</name>
<mode>once</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/relay-battery.wav</path>
<condition>
<greater-than>
<property>/systems/electrical/battery2-amps</property>
<value>25</value>
</greater-than>
</condition>
<property>/systems/electrical/sources/bat-2/contact</property>
<volume>
<factor>0.8</factor>
</volume>
@ -1593,18 +1583,7 @@
<name>RelayEXT</name>
<mode>once</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/relay-external.wav</path>
<condition>
<and>
<equals>
<property>/controls/electrical/ground-cart</property>
<value>1</value>
</equals>
<equals>
<property>/controls/electrical/switches/ext-pwr</property>
<value>1</value>
</equals>
</and>
</condition>
<property>/systems/electrical/relay/ext-epc/contact-pos</property>
<volume>
<factor>0.6</factor>
</volume>
@ -1614,12 +1593,7 @@
<name>RelayAPU</name>
<mode>once</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/relay-apu.wav</path>
<condition>
<equals>
<property>/systems/electrical/gen-apu</property>
<value>1</value>
</equals>
</condition>
<property>/systems/electrical/relay/apu-glc/contact-pos</property>
<volume>
<factor>0.6</factor>
</volume>

View file

@ -11,6 +11,14 @@
<!-- Battery 1 -->
<fcs_function name="/systems/electrical/sources/bat-1/volt">
<function>
<product>
<difference>
<value>1</value>
<product>
<property>/systems/electrical/sources/bat-1/amps</property>
<value>0.00016666</value>
</product>
</difference>
<table>
<independentVar lookup="row">/systems/electrical/sources/bat-1/percent</independentVar>
<independentVar lookup="column">/systems/failures/electrical/bat-1</independentVar>
@ -22,21 +30,165 @@
100 31.0 7.0
</tableData>
</table>
</product>
</function>
</fcs_function>
<switch name="/systems/electrical/sources/bat-1/amp"> <!-- TODO: should relate to load -->
<default value="0"/>
<test logic="AND" value="3">
/systems/electrical/sources/bat-1/limiter eq 1
<switch name="/systems/electrical/sources/bat-1/contact">
<default value="/systems/electrical/sources/bat-1/contact"/>
<test logic="OR" value="0"> <!-- discharge protection or switch turned off -->
/controls/electrical/switches/bat-1 eq 0
/systems/electrical/sources/bat-1/volt lt 23
/systems/electrical/sources/bat-1/amps ge 100
</test>
<test logic="AND" value="1"> <!-- apu start -->
/controls/electrical/switches/bat-1 eq 1
/systems/electrical/sources/bat-1/volt ge 10
/systems/apu/start eq 1
</test>
<test logic="AND" value="1"> <!-- connect to dc-bat while no other power on the ground -->
/controls/electrical/switches/bat-1 eq 1
/systems/electrical/bus/ac-1 lt 110
/systems/electrical/bus/ac-2 lt 110
/gear/gear[1]/wow eq 1
/instrumentation/airspeed-indicator/indicated-speed-kt lt 100
</test>
<test logic="AND" value="1"> <!-- start charging cycle -->
/systems/electrical/sources/bat-1/charge eq 1
</test>
<test logic="AND" value="1"> <!-- maintain charging cycle -->
/systems/electrical/sources/bat-1/charge eq 1
/controls/electrical/switches/bat-1 eq 1
/systems/electrical/sources/bat-1/contact eq 1
/systems/electrical/bus/dc-bat gt 27.5
/systems/electrical/sources/bat-1/percent-calc lt 99.9
</test>
<test logic="AND" value="0">
/systems/electrical/sources/bat-1/charge eq 0
</test>
</switch>
<switch name="/systems/electrical/sources/bat-1/charge">
<default value="/systems/electrical/sources/bat-1/charge"/>
<test logic="AND" value="0"> <!-- end charging cycle -->
/systems/electrical/sources/bat-1/charge eq 1
<test logic="OR">
/controls/electrical/switches/bat-1 eq 0
/systems/electrical/bus/dc-bat lt 27.5
/systems/electrical/sources/bat-1/percent-calc ge 99.9
</test>
</test>
<test logic="AND" value="1"> <!-- start charging cycle -->
/controls/electrical/switches/bat-1 eq 1
/systems/electrical/sources/bat-1/contact eq 0
/systems/electrical/sources/bat-1/volt lt 26.5
/systems/electrical/bus/dc-bat gt 27.5
</test>
</switch>
<switch name="/systems/electrical/sources/bat-1/direction">
<default value="0"/>
<test logic="AND" value="0">
/systems/electrical/sources/bat-1/contact eq 0
/systems/electrical/sources/si-1/inverter-active eq 0
</test>
<test logic="AND" value="1">
/systems/electrical/sources/si-1/inverter-active eq 1
</test>
<test logic="AND" value="1"> <!-- drain -->
/systems/electrical/sources/bat-1/contact eq 1
<test logic="OR">
<test logic="AND">
/systems/electrical/bus/dc-bat-src ne 1
/systems/electrical/bus/dc-bat-src ne 2
</test>
/systems/apu/start eq 1
</test>
</test>
<test logic="AND" value="-1"> <!-- charge -->
/systems/electrical/sources/bat-1/contact eq 1
/systems/electrical/bus/dc-bat-src ne 3
</test>
</switch>
<fcs_function name="/systems/electrical/sources/bat-1/percent-calc">
<function>
<ifthen>
<eq>
<property>/systems/electrical/sources/bat-1/direction</property>
<value>0</value>
</eq>
<property>/systems/electrical/sources/bat-1/percent-calc</property>
<ifthen>
<eq>
<property>/systems/electrical/sources/bat-1/direction</property>
<value>-1</value>
</eq>
<sum>
<property>/systems/electrical/sources/bat-1/percent</property>
<product>
<quotient>
<value>2.25</value>
<sum>
<property>/systems/electrical/sources/bat-1/percent</property>
<value>1</value>
</sum>
</quotient>
<property>simulation/channel-dt</property>
</product>
</sum>
<sum>
<property>/systems/electrical/sources/bat-1/percent</property>
<product>
<quotient>
<value>-0.75</value>
<sum>
<property>/systems/electrical/sources/bat-1/percent</property>
<value>1</value>
</sum>
</quotient>
<property>simulation/channel-dt</property>
</product>
</sum>
</ifthen>
</ifthen>
</function>
<output>/systems/electrical/sources/bat-1/percent</output>
</fcs_function>
<switch name="/systems/electrical/sources/bat-1/load-kw">
<default value="0"/>
<test logic="AND" value="0.864">
/systems/apu/start eq 1
/systems/electrical/sources/bat-1/contact eq 1
</test>
<test logic="AND" value="1.15"> <!-- 60 amp * 0.8 * 24V = 1.15kw. Guess -->
/systems/electrical/bus/dc-bat-src ne 1
/systems/electrical/bus/dc-bat-src ne 2
/systems/electrical/sources/bat-1/contact eq 1
</test>
</switch>
<switch name="/systems/electrical/sources/bat-1/amps">
<default value="0"/>
<test logic="AND" value="40">
/systems/electrical/sources/bat-1/load-kw ne 0
</test>
<test logic="AND" value="2">
/systems/electrical/sources/bat-1/contact eq 1
</test>
</switch>
<!-- Battery 2 -->
<fcs_function name="/systems/electrical/sources/bat-2/volt">
<function>
<product>
<difference>
<value>1</value>
<product>
<property>/systems/electrical/sources/bat-2/amps</property>
<value>0.00016666</value>
</product>
</difference>
<table>
<independentVar lookup="row">/systems/electrical/sources/bat-2/percent</independentVar>
<independentVar lookup="column">/systems/failures/electrical/bat-2</independentVar>
@ -48,15 +200,151 @@
100 31.0 7.0
</tableData>
</table>
</product>
</function>
</fcs_function>
<switch name="/systems/electrical/sources/bat-2/amp"> <!-- TODO: should relate to load -->
<default value="0"/>
<test logic="AND" value="2">
/systems/electrical/sources/bat-2/limiter eq 1
<switch name="/systems/electrical/sources/bat-2/contact">
<default value="/systems/electrical/sources/bat-2/contact"/>
<test logic="OR" value="0"> <!-- discharge protection or switch turned off -->
/controls/electrical/switches/bat-2 eq 0
/systems/electrical/sources/bat-2/volt lt 23
/systems/electrical/sources/bat-2/amps ge 100
</test>
<test logic="AND" value="1"> <!-- apu start -->
/controls/electrical/switches/bat-2 eq 1
/systems/electrical/sources/bat-2/volt ge 10
/systems/apu/start eq 1
</test>
<test logic="AND" value="1"> <!-- connect to dc-bat while no other power on the ground -->
/controls/electrical/switches/bat-2 eq 1
/systems/electrical/bus/ac-1 lt 110
/systems/electrical/bus/ac-2 lt 110
/gear/gear[1]/wow eq 1
/instrumentation/airspeed-indicator/indicated-speed-kt lt 100
</test>
<test logic="AND" value="1"> <!-- start charging cycle -->
/systems/electrical/sources/bat-2/charge eq 1
</test>
<test logic="AND" value="1"> <!-- maintain charging cycle -->
/systems/electrical/sources/bat-2/charge eq 1
/controls/electrical/switches/bat-2 eq 1
/systems/electrical/sources/bat-2/contact eq 1
/systems/electrical/bus/dc-bat gt 27.5
/systems/electrical/sources/bat-2/percent-calc lt 99.9
</test>
<test logic="AND" value="0">
/systems/electrical/sources/bat-2/charge eq 0
</test>
</switch>
<switch name="/systems/electrical/sources/bat-2/charge">
<default value="/systems/electrical/sources/bat-2/charge"/>
<test logic="AND" value="0"> <!-- end charging cycle -->
/systems/electrical/sources/bat-2/charge eq 1
<test logic="OR">
/controls/electrical/switches/bat-2 eq 0
/systems/electrical/bus/dc-bat lt 27.5
/systems/electrical/sources/bat-2/percent-calc ge 99.9
</test>
</test>
<test logic="AND" value="1"> <!-- start charging cycle -->
/controls/electrical/switches/bat-2 eq 1
/systems/electrical/sources/bat-2/contact eq 0
/systems/electrical/sources/bat-2/volt lt 26.5
/systems/electrical/bus/dc-bat gt 27.5
</test>
</switch>
<switch name="/systems/electrical/sources/bat-2/direction">
<default value="0"/>
<test logic="AND" value="0">
/systems/electrical/sources/bat-2/contact eq 0
/systems/electrical/sources/si-1/inverter-active eq 0
</test>
<test logic="AND" value="1">
/systems/electrical/sources/si-1/inverter-active eq 1
</test>
<test logic="AND" value="1"> <!-- drain -->
/systems/electrical/sources/bat-2/contact eq 1
<test logic="OR">
<test logic="AND">
/systems/electrical/bus/dc-bat-src ne 1
/systems/electrical/bus/dc-bat-src ne 2
</test>
/systems/apu/start eq 1
</test>
</test>
<test logic="AND" value="-1"> <!-- charge -->
/systems/electrical/sources/bat-2/contact eq 1
/systems/electrical/bus/dc-bat-src ne 3
</test>
</switch>
<fcs_function name="/systems/electrical/sources/bat-2/percent-calc">
<function>
<ifthen>
<eq>
<property>/systems/electrical/sources/bat-2/direction</property>
<value>0</value>
</eq>
<property>/systems/electrical/sources/bat-2/percent-calc</property>
<ifthen>
<eq>
<property>/systems/electrical/sources/bat-2/direction</property>
<value>-1</value>
</eq>
<sum>
<property>/systems/electrical/sources/bat-2/percent</property>
<product>
<quotient>
<value>2.25</value>
<sum>
<property>/systems/electrical/sources/bat-2/percent</property>
<value>1</value>
</sum>
</quotient>
<property>simulation/channel-dt</property>
</product>
</sum>
<sum>
<property>/systems/electrical/sources/bat-2/percent</property>
<product>
<quotient>
<value>-0.75</value>
<sum>
<property>/systems/electrical/sources/bat-2/percent</property>
<value>1</value>
</sum>
</quotient>
<property>simulation/channel-dt</property>
</product>
</sum>
</ifthen>
</ifthen>
</function>
<output>/systems/electrical/sources/bat-2/percent</output>
</fcs_function>
<switch name="/systems/electrical/sources/bat-2/load-kw">
<default value="0"/>
<test logic="AND" value="0.864">
/systems/apu/start eq 1
/systems/electrical/sources/bat-2/contact eq 1
</test>
<test logic="AND" value="1.15"> <!-- 60 amp * 0.8 * 24V = 1.15kw. Guess -->
/systems/electrical/bus/dc-bat-src ne 1
/systems/electrical/bus/dc-bat-src ne 2
/systems/electrical/sources/bat-2/contact eq 1
</test>
</switch>
<switch name="/systems/electrical/sources/bat-2/amps">
<default value="0"/>
<test logic="AND" value="40">
/systems/electrical/sources/bat-2/load-kw ne 0
</test>
<test logic="AND" value="2">
/systems/electrical/sources/bat-2/contact eq 1
</test>
</switch>
@ -360,7 +648,7 @@
</fcs_function>
<pure_gain name="/systems/electrical/sources/si-1/output-volt">
<input>/systems/electrical/sources/bat-1/volt</input>
<input>/systems/electrical/sources/bat-1/volt</input> <!-- inverter feeds directly from batteries -->
<gain>/systems/electrical/sources/si-1/inverter-gain</gain>
</pure_gain>
@ -1293,12 +1581,12 @@
<!-- Hot Buses -->
<pure_gain name="/systems/electrical/bus/dc-hot-1">
<input>/systems/electrical/sources/bat-1/volt</input>
<input>/systems/electrical/sources/bat-1/volt</input> <!-- todo CB 12PB1 / 5PB1 -->
<gain>1.0</gain>
</pure_gain>
<pure_gain name="/systems/electrical/bus/dc-hot-2">
<input>/systems/electrical/sources/bat-2/volt</input>
<input>/systems/electrical/sources/bat-2/volt</input> <!-- todo CB 12PB2 / 5PB2 -->
<gain>1.0</gain>
</pure_gain>

View file

@ -524,16 +524,7 @@
<fcs_function name="fbw/roll/rollout-cmd">
<function>
<product>
<table>
<independentVar lookup="row">/orientation/roll-deg</independentVar>
<tableData>
-30 -30
-1 0
0 0
1 0
30 30
</tableData>
</table>
<property>/orientation/roll-deg</property>
<value>-0.1</value>
</product>
</function>
@ -2081,7 +2072,7 @@
<switch name="fcs/steer-rate">
<default value="0"/>
<test logic="OR" value="75">
<test logic="OR" value="12">
hydraulics/tiller/hyd-pwr eq 1
/sim/model/autopush/connected eq 1
/systems/acconfig/autoconfig-running eq 1

View file

@ -415,21 +415,26 @@
</fcs_function>
<switch name="/systems/hydraulic/sources/ptu/ptu-inhibited">
<default value="1"/>
<test logic="OR" value="0">
<default value="0"/>
<test logic="AND" value="1">
/gear/gear[0]/compression-norm ne 0
<test logic="OR">
<test logic="AND">
/sim/model/autopush/enabled eq 0
/sim/model/autopush/enabled eq 1
/controls/gear/brake-parking eq 0
</test>
/controls/gear/brake-parking eq 1
</test>
<test logic="OR">
<test logic="AND">
/controls/engines/engine[0]/cutoff-switch eq 0
/controls/engines/engine[1]/cutoff-switch eq 0
/controls/engines/engine[1]/cutoff-switch eq 1
</test>
<test logic="AND">
/controls/engines/engine[0]/cutoff-switch eq 1
/controls/engines/engine[1]/cutoff-switch eq 1
/controls/engines/engine[1]/cutoff-switch eq 0
</test>
</test>
/gear/gear[0]/compression-norm eq 0
</test>
</switch>

View file

@ -69,7 +69,15 @@
<name>IT-CONTROLLER: VORLOC ROLL</name>
<debug>false</debug>
<type>gain</type>
<gain>2.8</gain>
<gain>
<expression>
<table>
<property>/fdm/jsbsim/velocities/vc-kts</property>
<entry><ind>140</ind><dep>1.8</dep></entry>
<entry><ind>360</ind><dep>2.8</dep></entry>
</table>
</expression>
</gain>
<enable>
<condition>
<and>

View file

@ -1 +1 @@
29
31