1
0
Fork 0

Merge branch 'ADIRS'

This commit is contained in:
legoboyvdlp R 2019-11-30 13:40:44 +00:00
commit 9f9fa01594
39 changed files with 3438 additions and 760 deletions

View file

@ -169,6 +169,8 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-hydraulic"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<system file="a320-adr"/>
<system file="a320-fmgc"/>
<flight_control name="none"/>

View file

@ -161,6 +161,7 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="glass-effect1"/>
<system file="a320-fcs"/>
<system file="a320-adr"/>
<system file="a320-fuel"/>
<system file="a320-fwc"/>
<system file="a320-spoiler"/>
@ -168,6 +169,8 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-hydraulic"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<system file="a320-adr"/>
<system file="a320-fmgc"/>
<flight_control name="none"/>

View file

@ -168,6 +168,8 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-hydraulic"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<system file="a320-adr"/>
<system file="a320-fmgc"/>
<flight_control name="none"/>
<aerodynamics file="Systems/a320-aerodynamics.xml"/>

View file

@ -142,6 +142,7 @@
<autopilot n="13">
<path>Aircraft/A320-family/Systems/ecam-proprules.xml</path>
</autopilot>
<path>Aircraft/A320-family/Systems/pitot-static.xml</path>
</systems>
<sound>
@ -505,13 +506,19 @@
<it-fbw n="0">
<alpha-hld type="bool">0</alpha-hld>
<degrade-law type="int">0</degrade-law>
<law type="int">0</law>
<roll-lim type="double">33</roll-lim>
<roll-lim type="string">33</roll-lim>
<roll-back type="bool">0</roll-back>
<override type="bool">0</override>
<protections n="0">
<overspeed type="bool">0</overspeed>
<overspeed-roll-back type="bool">0</overspeed-roll-back>
</protections>
<spd-hld type="bool">0</spd-hld>
<speeds>
<vmo-mmo type="int">350</vmo-mmo>
</speeds>
</it-fbw>
<apu>
@ -520,6 +527,7 @@
</apu>
<FMGC n="0">
<active-fmgc-channel type="int">0</active-fmgc-channel>
<internal>
<cost-index type="int">0</cost-index>
</internal>
@ -639,6 +647,26 @@
<throttle-fdm type="double">0</throttle-fdm>
</engine>
</engines>
<fctl>
<lights>
<elac1-fault type="bool">0</elac1-fault>
<elac2-fault type="bool">0</elac2-fault>
<sec1-fault type="bool">0</sec1-fault>
<sec2-fault type="bool">0</sec2-fault>
<sec3-fault type="bool">0</sec3-fault>
<fac1-fault type="bool">0</fac1-fault>
<fac2-fault type="bool">0</fac2-fault>
</lights>
<switches>
<elac1 type="bool">0</elac1>
<elac2 type="bool">0</elac2>
<sec1 type="bool">0</sec1>
<sec2 type="bool">0</sec2>
<sec3 type="bool">0</sec3>
<fac1 type="bool">0</fac1>
<fac2 type="bool">0</fac2>
</switches>
</fctl>
<fire>
<apu-test-btn type="bool">0</apu-test-btn>
<test-btn-1 type="bool">0</test-btn-1>
@ -730,6 +758,40 @@
<seatbelt-sign type="bool">0</seatbelt-sign>
<taxi-light-switch type="float">0</taxi-light-switch>
</lighting>
<navigation>
<adirscp>
<switches>
<adr-1 type="bool">0</adr-1>
<adr-2 type="bool">0</adr-2>
<adr-3 type="bool">0</adr-3>
<ir-1 type="bool">0</ir-1>
<ir-2 type="bool">0</ir-2>
<ir-3 type="bool">0</ir-3>
<ir-1-mode type="int">0</ir-1-mode>
<ir-2-mode type="int">0</ir-2-mode>
<ir-3-mode type="int">0</ir-3-mode>
</switches>
<lights>
<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>
<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>
<ir-1-off type="bool">0</ir-1-off>
<ir-2-off type="bool">0</ir-2-off>
<ir-3-off type="bool">0</ir-3-off>
<on-bat type="bool">0</on-bat>
</lights>
</adirscp>
<switching>
<att-hdg type="int">0</att-hdg>
<air-data type="int">0</air-data>
</switching>
</navigation>
<OH>
<protectors>
<ditching type="bool">0</ditching>
@ -902,6 +964,15 @@
<tr-1 type="bool">0</tr-1>
<tr-2 type="bool">0</tr-2>
</electrical>
<fctl>
<elac1 type="bool">0</elac1>
<elac2 type="bool">0</elac2>
<sec1 type="bool">0</sec1>
<sec2 type="bool">0</sec2>
<sec3 type="bool">0</sec3>
<fac1 type="bool">0</fac1>
<fac2 type="bool">0</fac2>
</fctl>
<hydraulic>
<blue-edp type="bool">0</blue-edp>
<blue-elec type="bool">0</blue-elec>
@ -931,6 +1002,11 @@
<cargo-aft-fire type="bool">0</cargo-aft-fire>
</failures>
<fctl n="0">
<elac1 type="bool">0</elac1>
<elac2 type="bool">0</elac2>
<sec1 type="bool">0</sec1>
<sec2 type="bool">0</sec2>
<sec3 type="bool">0</sec3>
<fac1 type="bool">0</fac1>
<fac2 type="bool">0</fac2>
</fctl>
@ -980,6 +1056,30 @@
<green-psi>0</green-psi>
<yellow-psi>0</yellow-psi>
</hydraulic>
<pitot n="1">
<serviceable>1</serviceable>
</pitot>
<pitot n="2">
<serviceable>1</serviceable>
</pitot>
<static n="1">
<serviceable>1</serviceable>
</static>
<static n="2">
<serviceable>1</serviceable>
</static>
<navigation>
<adr>
<operating-1 type="bool">0</operating-1>
<operating-2 type="bool">0</operating-2>
<operating-3 type="bool">0</operating-3>
</adr>
</navigation>
</systems>
<options n="0">
@ -994,6 +1094,26 @@
</options>
<instrumentation n="0">
<altimeter n="1">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="2">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="3">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="4">
<serviceable type="bool">true</serviceable>
</altimeter>
<altimeter n="5">
<serviceable type="bool">true</serviceable>
</altimeter>
<chrono n="0">
<started type="bool">0</started>
<paused type="bool">0</paused>
@ -1082,6 +1202,10 @@
<range type="double">1.0</range>
</groundradar>
<marker-beacon n="0">
<serviceable type="bool">true</serviceable>
</marker-beacon>
<nav n="0">
<frequencies>
<selected-mhz type="double">111.15</selected-mhz>
@ -1152,6 +1276,11 @@
</speaker>
</tcas>
<transponder>
<airspeed-input-src type="int">0</airspeed-input-src>
<altimeter-input-src type="int">0</altimeter-input-src>
</transponder>
<!-- See http://wiki.flightgear.org/index.php/GPWS -->
<mk-viii n="0">
<serviceable type="bool">true</serviceable>
@ -1183,6 +1312,34 @@
<file-prefix>Aircraft/A320-family/Sounds/GPWS/</file-prefix>
</voice>
</mk-viii>
<radar-altimeter n="0">
<antenna>
<x-offset-m type="double">-1</x-offset-m>
<y-offset-m type="double">0</y-offset-m>
<z-offset-m type="double">2.52</z-offset-m>
</antenna>
<az-step-deg type="int">10</az-step-deg>
<az-limit-deg type="int">30</az-limit-deg>
<elev-step-deg type="int">10</elev-step-deg>
<elev-limit type="int">30</elev-limit>
<max-range-m type="int">1219</max-range-m>
<serviceable type="bool">true</serviceable>
</radar-altimeter>
<radar-altimeter n="1">
<antenna>
<x-offset-m type="double">-1</x-offset-m>
<y-offset-m type="double">0</y-offset-m>
<z-offset-m type="double">2.52</z-offset-m>
</antenna>
<az-step-deg type="int">10</az-step-deg>
<az-limit-deg type="int">30</az-limit-deg>
<elev-step-deg type="int">10</elev-step-deg>
<elev-limit type="int">30</elev-limit>
<max-range-m type="int">1219</max-range-m>
<serviceable type="bool">true</serviceable>
</radar-altimeter>
</instrumentation>
<modes>
@ -1663,7 +1820,9 @@
<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.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/fire.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/brakes.nas</file>
<file>Aircraft/A320-family/Nasal/Systems/ground_services.nas</file>
@ -1741,6 +1900,9 @@
<atc>
<file>Aircraft/A320-family/Nasal/Panels/atc.nas</file>
</atc>
<dmc>
<file>Aircraft/A320-family/Nasal/Systems/DMC.nas</file>
</dmc>
<Dialogs>
<file>Aircraft/A320-family/gui/dialogs/refuel.nas</file>
</Dialogs>

View file

@ -168,6 +168,8 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-hydraulic"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<system file="a320-adr"/>
<system file="a320-fmgc"/>
<flight_control name="none"/>

View file

@ -168,6 +168,8 @@ xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">
<system file="a320-hydraulic"/>
<system file="a320-lights"/>
<system file="a320-engine-fire"/>
<system file="a320-adr"/>
<system file="a320-fmgc"/>
<flight_control name="none"/>

View file

@ -270,6 +270,9 @@ var colddark = func {
setprop("/controls/switches/landing-lights-l", 0.0);
setprop("/controls/switches/landing-lights-r", 0.0);
setprop("/controls/atc/mode-knob", 0);
setprop("/controls/lighting/fcu-panel-knb", 0);
setprop("/controls/lighting/main-panel-knb", 0);
setprop("/controls/lighting/overhead-panel-knb", 0);
atc.transponderPanel.modeSwitch(1);
libraries.systemsInit();
failResetOld();
@ -348,6 +351,9 @@ var beforestart_b = func {
systems.FUEL.Switches.pumpCenter2.setValue(1);
systems.FUEL.Switches.pumpRight1.setValue(1);
systems.FUEL.Switches.pumpRight2.setValue(1);
setprop("/controls/lighting/fcu-panel-knb", 1);
setprop("/controls/lighting/main-panel-knb", 1);
setprop("/controls/lighting/overhead-panel-knb", 1);
setprop("/controls/electrical/switches/apu", 1);
setprop("/controls/electrical/switches/galley", 1);
setprop("/controls/electrical/switches/gen-1", 1);
@ -360,6 +366,12 @@ 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");
systems.ADIRSControlPanel.adrSw(0);
systems.ADIRSControlPanel.adrSw(1);
systems.ADIRSControlPanel.adrSw(2);
systems.ADIRSControlPanel.irModeSw(0, 1);
systems.ADIRSControlPanel.irModeSw(1, 1);
systems.ADIRSControlPanel.irModeSw(2, 1);
systems.ADIRS.skip(0);
systems.ADIRS.skip(1);
systems.ADIRS.skip(2);
@ -430,6 +442,9 @@ var taxi_b = func {
systems.FUEL.Switches.pumpCenter2.setValue(1);
systems.FUEL.Switches.pumpRight1.setValue(1);
systems.FUEL.Switches.pumpRight2.setValue(1);
setprop("/controls/lighting/fcu-panel-knb", 1);
setprop("/controls/lighting/main-panel-knb", 1);
setprop("/controls/lighting/overhead-panel-knb", 1);
setprop("/controls/electrical/switches/apu", 1);
setprop("/controls/electrical/switches/galley", 1);
setprop("/controls/electrical/switches/gen-1", 1);
@ -442,6 +457,12 @@ 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");
systems.ADIRSControlPanel.adrSw(0);
systems.ADIRSControlPanel.adrSw(1);
systems.ADIRSControlPanel.adrSw(2);
systems.ADIRSControlPanel.irModeSw(0, 1);
systems.ADIRSControlPanel.irModeSw(1, 1);
systems.ADIRSControlPanel.irModeSw(2, 1);
systems.ADIRS.skip(0);
systems.ADIRS.skip(1);
systems.ADIRS.skip(2);

View file

@ -57,7 +57,7 @@
<checkbox>
<label>ELAC1</label>
<halign>left</halign>
<property>/systems/failures/elac1</property>
<property>/systems/failures/fctl/elac1</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -67,7 +67,7 @@
<checkbox>
<label>ELAC2</label>
<halign>left</halign>
<property>/systems/failures/elac2</property>
<property>/systems/failures/fctl/elac2</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -77,7 +77,7 @@
<checkbox>
<label>SEC1</label>
<halign>left</halign>
<property>/systems/failures/sec1</property>
<property>/systems/failures/fctl/sec1</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -87,7 +87,7 @@
<checkbox>
<label>SEC2</label>
<halign>left</halign>
<property>/systems/failures/sec2</property>
<property>/systems/failures/fctl/sec2</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -97,17 +97,7 @@
<checkbox>
<label>SEC3</label>
<halign>left</halign>
<property>/systems/failures/sec3</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>FAC2</label>
<halign>left</halign>
<property>/systems/failures/fac2</property>
<property>/systems/failures/fctl/sec3</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -117,7 +107,17 @@
<checkbox>
<label>FAC1</label>
<halign>left</halign>
<property>/systems/failures/fac1</property>
<property>/systems/failures/fctl/fac1</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>FAC2</label>
<halign>left</halign>
<property>/systems/failures/fctl/fac2</property>
<binding>
<command>dialog-apply</command>
</binding>

View file

@ -6087,7 +6087,66 @@
</binding>
</action>
</animation>
<animation>
<type>rotate</type>
<object-name>ecam_air_data</object-name>
<object-name>ecam_air_data.mark</object-name>
<factor>30</factor>
<property>/controls/navigation/switching/air-data</property>
<axis>
<x1-m>-0.428673</x1-m>
<y1-m>-0.022557</y1-m>
<z1-m>-0.051784</z1-m>
<x2-m>-0.430086</x2-m>
<y2-m>-0.022557</y2-m>
<z2-m>-0.060321</z2-m>
</axis>
</animation>
<animation>
<type>pick</type>
<object-name>ecam_air_data</object-name>
<action>
<button>0</button>
<button>3</button>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (systems.SwitchingPanel.Switches.airData.getValue() != 1) {
systems.SwitchingPanel.doAirData(systems.SwitchingPanel.Switches.airData.getValue() + 1);
} else {
systems.SwitchingPanel.doAirData(-1);
}
</script>
</binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/knb1", 1);</script>
</binding>
</action>
<action>
<button>2</button>
<button>4</button>
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>
if (systems.SwitchingPanel.Switches.airData.getValue() != -1) {
systems.SwitchingPanel.doAirData(systems.SwitchingPanel.Switches.airData.getValue() - 1);
} else {
systems.SwitchingPanel.doAirData(1);
}
</script>
</binding>
<binding>
<command>nasal</command>
<script>setprop("/sim/sounde/knb1", 1);</script>
</binding>
</action>
</animation>
<!-- Z Colors/Effects -->
<animation>
<type>material</type>

View file

@ -544,8 +544,22 @@ var canvas_lowerECAM_base = {
}
},
updateBottomStatus: func() {
me["TAT"].setText(sprintf("%2.0f", temperature_degc.getValue()));
me["SAT"].setText(sprintf("%2.0f", temperature_degc.getValue()));
if (dmc.DMController.DMCs[1].outputs[4] != nil) {
me["SAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[0].outputs[4].getValue()));
me["SAT"].setColor(0.0509,0.7529,0.2941);
} else {
me["SAT"].setText(sprintf("%s", "XX"));
me["SAT"].setColor(0.7333,0.3803,0);
}
if (dmc.DMController.DMCs[1].outputs[5] != nil) {
me["TAT"].setText(sprintf("%2.0f", dmc.DMController.DMCs[0].outputs[5].getValue()));
me["TAT"].setColor(0.0509,0.7529,0.2941);
} else {
me["TAT"].setText(sprintf("%s", "XX"));
me["TAT"].setColor(0.7333,0.3803,0);
}
me["GW"].setText(sprintf("%s", math.round(gw.getValue())));
me["UTCh"].setText(sprintf("%02d", hour.getValue()));
me["UTCm"].setText(sprintf("%02d", minute.getValue()));

View file

@ -61,7 +61,6 @@
<object-name>IR2Btn2A</object-name>
<object-name>IR3Btn1F</object-name>
<object-name>IR3Btn2A</object-name>
<object-name>IrsOnBatLightOB</object-name>
<object-name>RamAirBtn2O</object-name>
<object-name>SEC1Btn1F</object-name>
<object-name>SEC1Btn2O</object-name>
@ -521,11 +520,14 @@
<button>3</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/adirs/ir[0]/knob</property>
<value>0</value>
<value>1</value>
<value>2</value>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() + 1);
} else {
systems.ADIRSControlPanel.irModeSw(0, 0);
}
</script>
</binding>
<binding>
<command>nasal</command>
@ -537,11 +539,14 @@
<button>4</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/adirs/ir[0]/knob</property>
<value>2</value>
<value>1</value>
<value>0</value>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[0].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(0, systems.ADIRSnew.Switches.irModeSw[0].getValue() - 1);
} else {
systems.ADIRSControlPanel.irModeSw(0, 2);
}
</script>
</binding>
<binding>
<command>nasal</command>
@ -553,7 +558,7 @@
<animation>
<type>rotate</type>
<object-name>IR1ModeKnb</object-name>
<property>controls/adirs/ir[0]/knob</property>
<property>controls/navigation/adirscp/switches/ir-1-mode</property>
<interpolation>
<entry><ind>0</ind><dep>-35</dep></entry>
<entry><ind>1</ind><dep>0</dep></entry>
@ -575,7 +580,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/ir[0]/fault</property>
<property>controls/navigation/adirscp/lights/ir-1-fault</property>
<value>1</value>
</equals>
<equals>
@ -591,7 +596,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/ir[0]/align</property>
<property>controls/navigation/adirscp/lights/ir-1-off</property>
<value>1</value>
</equals>
<equals>
@ -611,11 +616,14 @@
<button>3</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/adirs/ir[1]/knob</property>
<value>0</value>
<value>1</value>
<value>2</value>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() + 1);
} else {
systems.ADIRSControlPanel.irModeSw(1, 0);
}
</script>
</binding>
<binding>
<command>nasal</command>
@ -627,11 +635,14 @@
<button>4</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/adirs/ir[1]/knob</property>
<value>2</value>
<value>1</value>
<value>0</value>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[1].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(1, systems.ADIRSnew.Switches.irModeSw[1].getValue() - 1);
} else {
systems.ADIRSControlPanel.irModeSw(1, 2);
}
</script>
</binding>
<binding>
<command>nasal</command>
@ -643,7 +654,7 @@
<animation>
<type>rotate</type>
<object-name>IR2ModeKnb</object-name>
<property>controls/adirs/ir[1]/knob</property>
<property>controls/navigation/adirscp/switches/ir-2-mode</property>
<interpolation>
<entry><ind>0</ind><dep>-35</dep></entry>
<entry><ind>1</ind><dep>0</dep></entry>
@ -665,7 +676,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/ir[1]/fault</property>
<property>controls/navigation/adirscp/lights/ir-2-fault</property>
<value>1</value>
</equals>
<equals>
@ -681,7 +692,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/ir[1]/align</property>
<property>controls/navigation/adirscp/lights/ir-2-off</property>
<value>1</value>
</equals>
<equals>
@ -701,11 +712,14 @@
<button>3</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/adirs/ir[2]/knob</property>
<value>0</value>
<value>1</value>
<value>2</value>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 2) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() + 1);
} else {
systems.ADIRSControlPanel.irModeSw(2, 0);
}
</script>
</binding>
<binding>
<command>nasal</command>
@ -717,11 +731,14 @@
<button>4</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>controls/adirs/ir[2]/knob</property>
<value>2</value>
<value>1</value>
<value>0</value>
<command>nasal</command>
<script>
if (systems.ADIRSnew.Switches.irModeSw[2].getValue() != 0) {
systems.ADIRSControlPanel.irModeSw(2, systems.ADIRSnew.Switches.irModeSw[2].getValue() - 1);
} else {
systems.ADIRSControlPanel.irModeSw(2, 2);
}
</script>
</binding>
<binding>
<command>nasal</command>
@ -733,7 +750,7 @@
<animation>
<type>rotate</type>
<object-name>IR3ModeKnb</object-name>
<property>controls/adirs/ir[2]/knob</property>
<property>controls/navigation/adirscp/switches/ir-3-mode</property>
<interpolation>
<entry><ind>0</ind><dep>-35</dep></entry>
<entry><ind>1</ind><dep>0</dep></entry>
@ -755,7 +772,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/ir[2]/fault</property>
<property>controls/navigation/adirscp/lights/ir-3-fault</property>
<value>1</value>
</equals>
<equals>
@ -771,7 +788,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/ir[2]/align</property>
<property>controls/navigation/adirscp/lights/ir-3-off</property>
<value>1</value>
</equals>
<equals>
@ -789,7 +806,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/onbat</property>
<property>controls/navigation/adirscp/lights/on-bat</property>
<value>1</value>
</equals>
<equals>
@ -818,8 +835,8 @@
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/adirs/adr[0]/off</property>
<command>nasal</command>
<script>systems.ADIRSControlPanel.adrSw(0);</script>
</binding>
<binding>
<command>nasal</command>
@ -834,7 +851,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/adr[0]/fault</property>
<property>controls/navigation/adirscp/lights/adr-1-fault</property>
<value>1</value>
</equals>
<equals>
@ -844,13 +861,14 @@
</or>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ADR1Btn2O</object-name>
<condition>
<or>
<equals>
<property>controls/adirs/adr[0]/off</property>
<property>controls/navigation/adirscp/lights/adr-1-off</property>
<value>1</value>
</equals>
<equals>
@ -879,8 +897,8 @@
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/adirs/adr[1]/off</property>
<command>nasal</command>
<script>systems.ADIRSControlPanel.adrSw(1);</script>
</binding>
<binding>
<command>nasal</command>
@ -895,7 +913,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/adr[1]/fault</property>
<property>controls/navigation/adirscp/lights/adr-2-fault</property>
<value>1</value>
</equals>
<equals>
@ -905,13 +923,14 @@
</or>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ADR2Btn2O</object-name>
<condition>
<or>
<equals>
<property>controls/adirs/adr[1]/off</property>
<property>controls/navigation/adirscp/lights/adr-2-off</property>
<value>1</value>
</equals>
<equals>
@ -940,8 +959,8 @@
<value>25</value>
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/adirs/adr[2]/off</property>
<command>nasal</command>
<script>systems.ADIRSControlPanel.adrSw(2);</script>
</binding>
<binding>
<command>nasal</command>
@ -956,7 +975,7 @@
<condition>
<or>
<equals>
<property>controls/adirs/adr[2]/fault</property>
<property>controls/navigation/adirscp/lights/adr-3-fault</property>
<value>1</value>
</equals>
<equals>
@ -966,13 +985,14 @@
</or>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ADR3Btn2O</object-name>
<condition>
<or>
<equals>
<property>controls/adirs/adr[2]/off</property>
<property>controls/navigation/adirscp/lights/adr-3-off</property>
<value>1</value>
</equals>
<equals>
@ -1174,7 +1194,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/elac1</property>
<property>controls/fctl/switches/elac1</property>
</binding>
<binding>
<command>nasal</command>
@ -1208,7 +1228,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/elac1</property>
<property>controls/fctl/switches/elac1</property>
<value>0</value>
</equals>
<equals>
@ -1237,7 +1257,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/sec1</property>
<property>controls/fctl/switches/sec1</property>
</binding>
<binding>
<command>nasal</command>
@ -1257,7 +1277,7 @@
<value>1</value>
</equals>
<equals>
<property>controls/fctl/sec1</property>
<property>controls/fctl/switches/sec1</property>
<value>1</value>
</equals>
</and>
@ -1275,7 +1295,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/sec1</property>
<property>controls/fctl/switches/sec1</property>
<value>0</value>
</equals>
<equals>
@ -1304,7 +1324,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/fac1</property>
<property>controls/fctl/switches/fac1</property>
</binding>
<binding>
<command>nasal</command>
@ -1324,7 +1344,7 @@
<value>1</value>
</equals>
<equals>
<property>controls/fctl/fac1</property>
<property>controls/fctl/switches/fac1</property>
<value>1</value>
</equals>
</and>
@ -1342,7 +1362,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/fac1</property>
<property>controls/fctl/switches/fac1</property>
<value>0</value>
</equals>
<equals>
@ -1371,7 +1391,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/elac2</property>
<property>controls/fctl/switches/elac2</property>
</binding>
<binding>
<command>nasal</command>
@ -1391,7 +1411,7 @@
<value>1</value>
</equals>
<equals>
<property>controls/fctl/elac2</property>
<property>controls/fctl/switches/elac2</property>
<value>1</value>
</equals>
</and>
@ -1409,7 +1429,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/elac2</property>
<property>controls/fctl/switches/elac2</property>
<value>0</value>
</equals>
<equals>
@ -1438,7 +1458,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/sec2</property>
<property>controls/fctl/switches/sec2</property>
</binding>
<binding>
<command>nasal</command>
@ -1458,7 +1478,7 @@
<value>1</value>
</equals>
<equals>
<property>controls/fctl/sec2</property>
<property>controls/fctl/switches/sec2</property>
<value>1</value>
</equals>
</and>
@ -1476,7 +1496,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/sec2</property>
<property>controls/fctl/switches/sec2</property>
<value>0</value>
</equals>
<equals>
@ -1505,7 +1525,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/sec3</property>
<property>controls/fctl/switches/sec3</property>
</binding>
<binding>
<command>nasal</command>
@ -1525,7 +1545,7 @@
<value>1</value>
</equals>
<equals>
<property>controls/fctl/sec3</property>
<property>controls/fctl/switches/sec3</property>
<value>1</value>
</equals>
</and>
@ -1543,7 +1563,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/sec3</property>
<property>controls/fctl/switches/sec3</property>
<value>0</value>
</equals>
<equals>
@ -1572,7 +1592,7 @@
</greater-than-equals>
</condition>
<command>property-toggle</command>
<property>controls/fctl/fac2</property>
<property>controls/fctl/switches/fac2</property>
</binding>
<binding>
<command>nasal</command>
@ -1592,7 +1612,7 @@
<value>1</value>
</equals>
<equals>
<property>controls/fctl/fac2</property>
<property>controls/fctl/switches/fac2</property>
<value>1</value>
</equals>
</and>
@ -1610,7 +1630,7 @@
<condition>
<or>
<equals>
<property>controls/fctl/fac2</property>
<property>controls/fctl/switches/fac2</property>
<value>0</value>
</equals>
<equals>

View file

@ -13,11 +13,6 @@ var PFD2_display = nil;
var updateL = 0;
var updateR = 0;
var elapsedtime = 0;
var ASI = 0;
var ASItrgt = 0;
var ASItrgtdiff = 0;
var ASImax = 0;
var ASItrend = 0;
var altTens = 0;
var altPolarity = "";
@ -133,7 +128,9 @@ var hdg_diff = props.globals.initNode("/instrumentation/pfd/hdg-diff", 0.0, "DOU
var hdg_scale = props.globals.initNode("/instrumentation/pfd/heading-scale", 0.0, "DOUBLE");
var track = props.globals.initNode("/instrumentation/pfd/track-deg", 0.0, "DOUBLE");
var track_diff = props.globals.initNode("/instrumentation/pfd/track-hdg-diff", 0.0, "DOUBLE");
var speed_pred = props.globals.initNode("/instrumentation/pfd/speed-lookahead", 0.0, "DOUBLE");
var speed_pred_1 = props.globals.initNode("/instrumentation/pfd/speed-lookahead-1", 0.0, "DOUBLE");
var speed_pred_2 = props.globals.initNode("/instrumentation/pfd/speed-lookahead-2", 0.0, "DOUBLE");
var speed_pred_3 = props.globals.initNode("/instrumentation/pfd/speed-lookahead-3", 0.0, "DOUBLE");
var du1_test = props.globals.initNode("/instrumentation/du/du1-test", 0, "BOOL");
var du1_test_time = props.globals.initNode("/instrumentation/du/du1-test-time", 0.0, "DOUBLE");
var du1_test_amount = props.globals.initNode("/instrumentation/du/du1-test-amount", 0.0, "DOUBLE");
@ -197,7 +194,7 @@ var canvas_PFD_base = {
"AI_bank_lim","AI_bank_lim_X","AI_pitch_lim","AI_pitch_lim_X","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky","AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","AI_error","AI_group","FD_roll","FD_pitch","ALT_scale","ALT_target",
"ALT_target_digit","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_digit_UP","ALT_digit_DN","ALT_error","ALT_group","ALT_group2","ALT_frame","VS_pointer","VS_box","VS_digit","VS_error","VS_group","QNH","QNH_setting",
"QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","HDG_error","HDG_group","HDG_frame",
"TRK_pointer"];
"TRK_pointer","machError"];
},
update: func() {
elapsedtime_act = elapsedtime.getValue();
@ -609,119 +606,6 @@ var canvas_PFD_base = {
}
},
updateCommonFast: func() {
# Airspeed
ind_spd = ind_spd_kt.getValue();
# Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations
if (ind_spd <= 30) {
ASI = 0;
} else if (ind_spd >= 420) {
ASI = 390;
} else {
ASI = ind_spd - 30;
}
FMGC_max = FMGC_max_spd.getValue();
if (FMGC_max <= 30) {
ASImax = 0 - ASI;
} else if (FMGC_max >= 420) {
ASImax = 390 - ASI;
} else {
ASImax = FMGC_max - 30 - ASI;
}
me["ASI_scale"].setTranslation(0, ASI * 6.6);
me["ASI_max"].setTranslation(0, ASImax * -6.6);
ind_mach = ind_spd_mach.getValue();
if (ind_mach >= 0.5) {
me["ASI_mach_decimal"].show();
me["ASI_mach"].show();
} else {
me["ASI_mach_decimal"].hide();
me["ASI_mach"].hide();
}
if (ind_mach >= 0.999) {
me["ASI_mach"].setText("999");
} else {
me["ASI_mach"].setText(sprintf("%3.0f", ind_mach * 1000));
}
if (managed_spd.getValue() == 1) {
me["ASI_target"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450);
} else {
me["ASI_target"].setColor(0.0901,0.6039,0.7176);
me["ASI_digit_UP"].setColor(0.0901,0.6039,0.7176);
me["ASI_decimal_UP"].setColor(0.0901,0.6039,0.7176);
me["ASI_digit_DN"].setColor(0.0901,0.6039,0.7176);
me["ASI_decimal_DN"].setColor(0.0901,0.6039,0.7176);
}
tgt_ias = at_tgt_ias.getValue();
if (tgt_ias <= 30) {
ASItrgt = 0 - ASI;
} else if (tgt_ias >= 420) {
ASItrgt = 390 - ASI;
} else {
ASItrgt = tgt_ias - 30 - ASI;
}
ASItrgtdiff = tgt_ias - ind_spd;
if (ASItrgtdiff >= -42 and ASItrgtdiff <= 42) {
me["ASI_target"].setTranslation(0, ASItrgt * -6.6);
me["ASI_digit_UP"].hide();
me["ASI_decimal_UP"].hide();
me["ASI_digit_DN"].hide();
me["ASI_decimal_DN"].hide();
me["ASI_target"].show();
} else if (ASItrgtdiff < -42) {
if (at_mach_mode.getValue() == 1) {
me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].show();
} else {
me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_kts.getValue()));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_DN"].show();
me["ASI_digit_UP"].hide();
me["ASI_target"].hide();
} else if (ASItrgtdiff > 42) {
if (at_mach_mode.getValue() == 1) {
me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000));
me["ASI_decimal_UP"].show();
me["ASI_decimal_DN"].hide();
} else {
me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_kts.getValue()));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_UP"].show();
me["ASI_digit_DN"].hide();
me["ASI_target"].hide();
}
ASItrend = speed_pred.getValue() - ASI;
me["ASI_trend_up"].setTranslation(0, math.clamp(ASItrend, 0, 50) * -6.6);
me["ASI_trend_down"].setTranslation(0, math.clamp(ASItrend, -50, 0) * -6.6);
if (ASItrend >= 2) {
me["ASI_trend_up"].show();
me["ASI_trend_down"].hide();
} else if (ASItrend <= -2) {
me["ASI_trend_down"].show();
me["ASI_trend_up"].hide();
} else {
me["ASI_trend_up"].hide();
me["ASI_trend_down"].hide();
}
# Attitude Indicator
pitch_cur = pitch.getValue();
roll_cur = roll.getValue();
@ -789,69 +673,6 @@ var canvas_PFD_base = {
me["AI_stick_pos"].setTranslation(aileron_input.getValue() * 196.8, elevator_input.getValue() * 151.5);
# Altitude
me.altitude = altitude.getValue();
me.altOffset = me.altitude / 500 - int(me.altitude / 500);
me.middleAltText = roundaboutAlt(me.altitude / 100);
me.middleAltOffset = nil;
if (me.altOffset > 0.5) {
me.middleAltOffset = -(me.altOffset - 1) * 243.3424;
} else {
me.middleAltOffset = -me.altOffset * 243.3424;
}
me["ALT_scale"].setTranslation(0, -me.middleAltOffset);
me["ALT_scale"].update();
me["ALT_five"].setText(sprintf("%03d", abs(me.middleAltText+10)));
me["ALT_four"].setText(sprintf("%03d", abs(me.middleAltText+5)));
me["ALT_three"].setText(sprintf("%03d", abs(me.middleAltText)));
me["ALT_two"].setText(sprintf("%03d", abs(me.middleAltText-5)));
me["ALT_one"].setText(sprintf("%03d", abs(me.middleAltText-10)));
if (altitude.getValue() < 0) {
altPolarity = "-";
} else {
altPolarity = "";
}
me["ALT_digits"].setText(sprintf("%s%d", altPolarity, altitude_pfd.getValue()));
altTens = num(right(sprintf("%02d", altitude.getValue()), 2));
me["ALT_tens"].setTranslation(0, altTens * 1.392);
ap_alt_cur = ap_alt.getValue();
alt_diff_cur = alt_diff.getValue();
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
me["ALT_digit_UP"].hide();
me["ALT_digit_DN"].hide();
me["ALT_target"].show();
} else if (alt_diff_cur < -565) {
if (alt_std_mode.getValue() == 1) {
if (ap_alt_cur < 10000) {
me["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
} else {
me["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
}
} else {
me["ALT_digit_DN"].setText(sprintf("%5.0f", ap_alt_cur));
}
me["ALT_digit_DN"].show();
me["ALT_digit_UP"].hide();
me["ALT_target"].hide();
} else if (alt_diff_cur > 565) {
if (alt_std_mode.getValue() == 1) {
if (ap_alt_cur < 10000) {
me["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
} else {
me["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
}
} else {
me["ALT_digit_UP"].setText(sprintf("%5.0f", ap_alt_cur));
}
me["ALT_digit_UP"].show();
me["ALT_digit_DN"].hide();
me["ALT_target"].hide();
}
# Vertical Speed
me["VS_pointer"].setRotation(vs_needle.getValue() * D2R);
@ -947,6 +768,12 @@ var canvas_PFD_base = {
};
var canvas_PFD_1 = {
ASI: 0,
ASImax: 0,
ASItrend: 0,
ASItrgt: 0,
ASItrgtdiff: 0,
FMGC_max: 0,
new: func(canvas_group, file) {
var m = {parents: [canvas_PFD_1, canvas_PFD_base]};
m.init(canvas_group, file);
@ -964,26 +791,10 @@ var canvas_PFD_1 = {
# Errors
if ((adirs0_active.getValue() == 1) or (air_switch.getValue() == -1 and adirs2_active.getValue() == 1)) {
me["ASI_group"].show();
me["ALT_group"].show();
me["ALT_group2"].show();
me["ALT_scale"].show();
me["VS_group"].show();
me["ASI_error"].hide();
me["ASI_frame"].setColor(1,1,1);
me["ALT_error"].hide();
me["ALT_frame"].setColor(1,1,1);
me["VS_error"].hide();
} else {
me["ASI_error"].show();
me["ASI_frame"].setColor(1,0,0);
me["ALT_error"].show();
me["ALT_frame"].setColor(1,0,0);
me["VS_error"].show();
me["ASI_group"].hide();
me["ALT_group"].hide();
me["ALT_group2"].hide();
me["ALT_scale"].hide();
me["VS_group"].hide();
}
@ -1037,11 +848,225 @@ var canvas_PFD_1 = {
me.updateCommon();
},
updateFast: func() {
# Airspeed
# ind_spd = ind_spd_kt.getValue();
# Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations
if (dmc.DMController.DMCs[0].outputs[0] != nil) {
ind_spd = dmc.DMController.DMCs[0].outputs[0].getValue();
me["ASI_error"].hide();
me["ASI_frame"].setColor(1,1,1);
me["ASI_group"].show();
if (ind_spd <= 30) {
me.ASI = 0;
} else if (ind_spd >= 420) {
me.ASI = 390;
} else {
me.ASI = ind_spd - 30;
}
me.FMGC_max = FMGC_max_spd.getValue();
if (me.FMGC_max <= 30) {
me.ASImax = 0 - me.ASI;
} else if (me.FMGC_max >= 420) {
me.ASImax = 390 - me.ASI;
} else {
me.ASImax = me.FMGC_max - 30 - me.ASI;
}
me["ASI_scale"].setTranslation(0, me.ASI * 6.6);
me["ASI_max"].setTranslation(0, me.ASImax * -6.6);
if (managed_spd.getValue() == 1) {
me["ASI_target"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450);
} else {
me["ASI_target"].setColor(0.0901,0.6039,0.7176);
me["ASI_digit_UP"].setColor(0.0901,0.6039,0.7176);
me["ASI_decimal_UP"].setColor(0.0901,0.6039,0.7176);
me["ASI_digit_DN"].setColor(0.0901,0.6039,0.7176);
me["ASI_decimal_DN"].setColor(0.0901,0.6039,0.7176);
}
tgt_ias = at_tgt_ias.getValue();
if (tgt_ias <= 30) {
me.ASItrgt = 0 - me.ASI;
} else if (tgt_ias >= 420) {
me.ASItrgt = 390 - me.ASI;
} else {
me.ASItrgt = tgt_ias - 30 - me.ASI;
}
me.ASItrgtdiff = tgt_ias - ind_spd;
if (me.ASItrgtdiff >= -42 and me.ASItrgtdiff <= 42) {
me["ASI_target"].setTranslation(0, me.ASItrgt * -6.6);
me["ASI_digit_UP"].hide();
me["ASI_decimal_UP"].hide();
me["ASI_digit_DN"].hide();
me["ASI_decimal_DN"].hide();
me["ASI_target"].show();
} else if (me.ASItrgtdiff < -42) {
if (at_mach_mode.getValue() == 1) {
me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].show();
} else {
me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_kts.getValue()));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_DN"].show();
me["ASI_digit_UP"].hide();
me["ASI_target"].hide();
} else if (me.ASItrgtdiff > 42) {
if (at_mach_mode.getValue() == 1) {
me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000));
me["ASI_decimal_UP"].show();
me["ASI_decimal_DN"].hide();
} else {
me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_kts.getValue()));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_UP"].show();
me["ASI_digit_DN"].hide();
me["ASI_target"].hide();
}
me.ASItrend = speed_pred_1.getValue() - me.ASI;
me["ASI_trend_up"].setTranslation(0, math.clamp(me.ASItrend, 0, 50) * -6.6);
me["ASI_trend_down"].setTranslation(0, math.clamp(me.ASItrend, -50, 0) * -6.6);
if (me.ASItrend >= 2) {
me["ASI_trend_up"].show();
me["ASI_trend_down"].hide();
} else if (me.ASItrend <= -2) {
me["ASI_trend_down"].show();
me["ASI_trend_up"].hide();
} else {
me["ASI_trend_up"].hide();
me["ASI_trend_down"].hide();
}
} else {
me["ASI_group"].hide();
me["ASI_error"].show();
me["ASI_frame"].setColor(1,0,0);
}
if (dmc.DMController.DMCs[0].outputs[2] != nil) {
ind_mach = dmc.DMController.DMCs[0].outputs[2].getValue();
me["machError"].hide();
if (ind_mach >= 0.5) {
me["ASI_mach_decimal"].show();
me["ASI_mach"].show();
} else {
me["ASI_mach_decimal"].hide();
me["ASI_mach"].hide();
}
if (ind_mach >= 0.999) {
me["ASI_mach"].setText("999");
} else {
me["ASI_mach"].setText(sprintf("%3.0f", ind_mach * 1000));
}
} else {
me["machError"].show();
}
# Altitude
if (dmc.DMController.DMCs[0].outputs[1] != nil) {
me["ALT_error"].hide();
me["ALT_frame"].setColor(1,1,1);
me["ALT_group"].show();
me["ALT_group2"].show();
me["ALT_scale"].show();
me.altitude = dmc.DMController.DMCs[0].outputs[1].getValue();
me.altOffset = me.altitude / 500 - int(me.altitude / 500);
me.middleAltText = roundaboutAlt(me.altitude / 100);
me.middleAltOffset = nil;
if (me.altOffset > 0.5) {
me.middleAltOffset = -(me.altOffset - 1) * 243.3424;
} else {
me.middleAltOffset = -me.altOffset * 243.3424;
}
me["ALT_scale"].setTranslation(0, -me.middleAltOffset);
me["ALT_scale"].update();
me["ALT_five"].setText(sprintf("%03d", abs(me.middleAltText+10)));
me["ALT_four"].setText(sprintf("%03d", abs(me.middleAltText+5)));
me["ALT_three"].setText(sprintf("%03d", abs(me.middleAltText)));
me["ALT_two"].setText(sprintf("%03d", abs(me.middleAltText-5)));
me["ALT_one"].setText(sprintf("%03d", abs(me.middleAltText-10)));
if (altitude.getValue() < 0) {
altPolarity = "-";
} else {
altPolarity = "";
}
me["ALT_digits"].setText(sprintf("%s%d", altPolarity, dmc.DMController.DMCs[0].outputs[3].getValue()));
altTens = num(right(sprintf("%02d", me.altitude), 2));
me["ALT_tens"].setTranslation(0, altTens * 1.392);
ap_alt_cur = ap_alt.getValue();
alt_diff_cur = alt_diff.getValue();
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
me["ALT_digit_UP"].hide();
me["ALT_digit_DN"].hide();
me["ALT_target"].show();
} else if (alt_diff_cur < -565) {
if (alt_std_mode.getValue() == 1) {
if (ap_alt_cur < 10000) {
me["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
} else {
me["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
}
} else {
me["ALT_digit_DN"].setText(sprintf("%5.0f", ap_alt_cur));
}
me["ALT_digit_DN"].show();
me["ALT_digit_UP"].hide();
me["ALT_target"].hide();
} else if (alt_diff_cur > 565) {
if (alt_std_mode.getValue() == 1) {
if (ap_alt_cur < 10000) {
me["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
} else {
me["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
}
} else {
me["ALT_digit_UP"].setText(sprintf("%5.0f", ap_alt_cur));
}
me["ALT_digit_UP"].show();
me["ALT_digit_DN"].hide();
me["ALT_target"].hide();
}
} else {
me["ALT_error"].show();
me["ALT_frame"].setColor(1,0,0);
me["ALT_group"].hide();
me["ALT_group2"].hide();
me["ALT_scale"].hide();
}
me.updateCommonFast();
},
};
var canvas_PFD_2 = {
ASI: 0,
ASImax: 0,
ASItrend: 0,
ASItrgt: 0,
ASItrgtdiff: 0,
FMGC_max: 0,
new: func(canvas_group, file) {
var m = {parents: [canvas_PFD_2, canvas_PFD_base]};
m.init(canvas_group, file);
@ -1059,19 +1084,14 @@ var canvas_PFD_2 = {
# Errors
if ((adirs1_active.getValue() == 1) or (air_switch.getValue() == 1 and adirs2_active.getValue() == 1)) {
me["ASI_group"].show();
me["ALT_group"].show();
me["ALT_group2"].show();
me["ALT_scale"].show();
me["VS_group"].show();
me["ASI_error"].hide();
me["ASI_frame"].setColor(1,1,1);
me["ALT_error"].hide();
me["ALT_frame"].setColor(1,1,1);
me["VS_error"].hide();
} else {
me["ASI_error"].show();
me["ASI_frame"].setColor(1,0,0);
me["ALT_error"].show();
me["ALT_frame"].setColor(1,0,0);
me["VS_error"].show();
@ -1132,6 +1152,213 @@ var canvas_PFD_2 = {
me.updateCommon();
},
updateFast: func() {
# Airspeed
# ind_spd = ind_spd_kt.getValue();
# Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations
if (dmc.DMController.DMCs[1].outputs[0] != nil) {
ind_spd = dmc.DMController.DMCs[1].outputs[0].getValue();
me["ASI_error"].hide();
me["ASI_frame"].setColor(1,1,1);
me["ASI_group"].show();
if (ind_spd <= 30) {
me.ASI = 0;
} else if (ind_spd >= 420) {
me.ASI = 390;
} else {
me.ASI = ind_spd - 30;
}
me.FMGC_max = FMGC_max_spd.getValue();
if (me.FMGC_max <= 30) {
me.ASImax = 0 - me.ASI;
} else if (me.FMGC_max >= 420) {
me.ASImax = 390 - me.ASI;
} else {
me.ASImax = me.FMGC_max - 30 - me.ASI;
}
me["ASI_scale"].setTranslation(0, me.ASI * 6.6);
me["ASI_max"].setTranslation(0, me.ASImax * -6.6);
if (managed_spd.getValue() == 1) {
me["ASI_target"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450);
} else {
me["ASI_target"].setColor(0.0901,0.6039,0.7176);
me["ASI_digit_UP"].setColor(0.0901,0.6039,0.7176);
me["ASI_decimal_UP"].setColor(0.0901,0.6039,0.7176);
me["ASI_digit_DN"].setColor(0.0901,0.6039,0.7176);
me["ASI_decimal_DN"].setColor(0.0901,0.6039,0.7176);
}
tgt_ias = at_tgt_ias.getValue();
if (tgt_ias <= 30) {
me.ASItrgt = 0 - me.ASI;
} else if (tgt_ias >= 420) {
me.ASItrgt = 390 - me.ASI;
} else {
me.ASItrgt = tgt_ias - 30 - me.ASI;
}
me.ASItrgtdiff = tgt_ias - ind_spd;
if (me.ASItrgtdiff >= -42 and me.ASItrgtdiff <= 42) {
me["ASI_target"].setTranslation(0, me.ASItrgt * -6.6);
me["ASI_digit_UP"].hide();
me["ASI_decimal_UP"].hide();
me["ASI_digit_DN"].hide();
me["ASI_decimal_DN"].hide();
me["ASI_target"].show();
} else if (me.ASItrgtdiff < -42) {
if (at_mach_mode.getValue() == 1) {
me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].show();
} else {
me["ASI_digit_DN"].setText(sprintf("%3.0f", at_input_spd_kts.getValue()));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_DN"].show();
me["ASI_digit_UP"].hide();
me["ASI_target"].hide();
} else if (me.ASItrgtdiff > 42) {
if (at_mach_mode.getValue() == 1) {
me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_mach.getValue() * 1000));
me["ASI_decimal_UP"].show();
me["ASI_decimal_DN"].hide();
} else {
me["ASI_digit_UP"].setText(sprintf("%3.0f", at_input_spd_kts.getValue()));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_UP"].show();
me["ASI_digit_DN"].hide();
me["ASI_target"].hide();
}
me.ASItrend = speed_pred_2.getValue() - me.ASI;
me["ASI_trend_up"].setTranslation(0, math.clamp(me.ASItrend, 0, 50) * -6.6);
me["ASI_trend_down"].setTranslation(0, math.clamp(me.ASItrend, -50, 0) * -6.6);
if (me.ASItrend >= 2) {
me["ASI_trend_up"].show();
me["ASI_trend_down"].hide();
} else if (me.ASItrend <= -2) {
me["ASI_trend_down"].show();
me["ASI_trend_up"].hide();
} else {
me["ASI_trend_up"].hide();
me["ASI_trend_down"].hide();
}
} else {
me["ASI_error"].show();
me["ASI_frame"].setColor(1,0,0);
me["ASI_group"].hide();
}
if (dmc.DMController.DMCs[1].outputs[2] != nil) {
ind_mach = dmc.DMController.DMCs[1].outputs[2].getValue();
me["machError"].hide();
if (ind_mach >= 0.5) {
me["ASI_mach_decimal"].show();
me["ASI_mach"].show();
} else {
me["ASI_mach_decimal"].hide();
me["ASI_mach"].hide();
}
if (ind_mach >= 0.999) {
me["ASI_mach"].setText("999");
} else {
me["ASI_mach"].setText(sprintf("%3.0f", ind_mach * 1000));
}
} else {
me["machError"].show();
}
if (dmc.DMController.DMCs[1].outputs[1] != nil) {
me["ALT_error"].hide();
me["ALT_frame"].setColor(1,1,1);
me["ALT_group"].show();
me["ALT_group2"].show();
me["ALT_scale"].show();
me.altitude = dmc.DMController.DMCs[1].outputs[1].getValue();
me.altOffset = me.altitude / 500 - int(me.altitude / 500);
me.middleAltText = roundaboutAlt(me.altitude / 100);
me.middleAltOffset = nil;
if (me.altOffset > 0.5) {
me.middleAltOffset = -(me.altOffset - 1) * 243.3424;
} else {
me.middleAltOffset = -me.altOffset * 243.3424;
}
me["ALT_scale"].setTranslation(0, -me.middleAltOffset);
me["ALT_scale"].update();
me["ALT_five"].setText(sprintf("%03d", abs(me.middleAltText+10)));
me["ALT_four"].setText(sprintf("%03d", abs(me.middleAltText+5)));
me["ALT_three"].setText(sprintf("%03d", abs(me.middleAltText)));
me["ALT_two"].setText(sprintf("%03d", abs(me.middleAltText-5)));
me["ALT_one"].setText(sprintf("%03d", abs(me.middleAltText-10)));
if (altitude.getValue() < 0) {
altPolarity = "-";
} else {
altPolarity = "";
}
me["ALT_digits"].setText(sprintf("%s%d", altPolarity, dmc.DMController.DMCs[1].outputs[3].getValue()));
altTens = num(right(sprintf("%02d", me.altitude), 2));
me["ALT_tens"].setTranslation(0, altTens * 1.392);
ap_alt_cur = ap_alt.getValue();
alt_diff_cur = alt_diff.getValue();
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
me["ALT_digit_UP"].hide();
me["ALT_digit_DN"].hide();
me["ALT_target"].show();
} else if (alt_diff_cur < -565) {
if (alt_std_mode.getValue() == 1) {
if (ap_alt_cur < 10000) {
me["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
} else {
me["ALT_digit_DN"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
}
} else {
me["ALT_digit_DN"].setText(sprintf("%5.0f", ap_alt_cur));
}
me["ALT_digit_DN"].show();
me["ALT_digit_UP"].hide();
me["ALT_target"].hide();
} else if (alt_diff_cur > 565) {
if (alt_std_mode.getValue() == 1) {
if (ap_alt_cur < 10000) {
me["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
} else {
me["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ ap_alt_cur / 100));
}
} else {
me["ALT_digit_UP"].setText(sprintf("%5.0f", ap_alt_cur));
}
me["ALT_digit_UP"].show();
me["ALT_digit_DN"].hide();
me["ALT_target"].hide();
}
} else {
me["ALT_error"].show();
me["ALT_frame"].setColor(1,0,0);
me["ALT_group"].hide();
me["ALT_group2"].hide();
me["ALT_scale"].hide();
}
me.updateCommonFast();
},
};

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 277 KiB

After

Width:  |  Height:  |  Size: 276 KiB

View file

@ -484,4 +484,5 @@
</and>
</condition>
</animation>
</PropertyList>

View file

@ -15,7 +15,7 @@ var overflow = props.globals.initNode("/ECAM/warnings/overflow", 0, "BOOL");
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess", 1);
var lights = [props.globals.initNode("/ECAM/warnings/master-warning-light", 0, "BOOL"), props.globals.initNode("/ECAM/warnings/master-caution-light", 0, "BOOL")];
var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL")];
var aural = [props.globals.initNode("/sim/sound/warnings/crc", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/chime", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL")];
var warningFlash = props.globals.initNode("/ECAM/warnings/master-warning-flash", 0, "BOOL");
var lineIndex = 0;
@ -43,11 +43,13 @@ var warning = {
t.sdPage = sdPage;
t.isMemo = isMemo;
t.hasCalled = 0;
t.wasActive = 0;
return t
},
write: func() {
if (me.active == 0) { return; }
me.wasActive = 1;
lineIndex = 0;
while (lineIndex < 7 and lines[lineIndex].getValue() != "") {
lineIndex = lineIndex + 1; # go to next line until empty line
@ -65,16 +67,30 @@ var warning = {
}
},
warnlight: func() {
if (me.light > 1 or me.noRepeat == 1 or me.active == 0) {return;}
if (me.light > 1) { return; }
if (me.active == 0 and me.wasActive == 1) {
lights[me.light].setBoolValue(0);
me.wasActive = 0;
}
if (me.noRepeat == 1 or me.active == 0) { return; }
lights[me.light].setBoolValue(1);
me.noRepeat = 1;
},
sound: func() {
if (me.aural > 1 or me.noRepeat2 == 1 or me.active == 0) {return;}
if (me.aural > 2) { return; }
if (me.active == 0 and me.wasActive == 1) {
aural[me.aural].setBoolValue(0);
me.wasActive = 0;
}
if (me.noRepeat2 == 1 or me.active == 0) { return; }
if (me.aural != 0) {
aural[me.aural].setBoolValue(0);
}
me.noRepeat2 = 1;
me.noRepeat2 = 1;
settimer(func() {
aural[me.aural].setBoolValue(1);
}, 0.15);
@ -144,6 +160,7 @@ var status = {
var ECAM_controller = {
_recallCounter: 0,
_noneActive: 0,
init: func() {
ECAMloopTimer.start();
me.reset();
@ -190,6 +207,9 @@ var ECAM_controller = {
w.warnlight();
w.sound();
counter += 1;
} elsif (w.wasActive == 1) {
w.warnlight();
w.sound();
}
}
}
@ -295,6 +315,7 @@ var ECAM_controller = {
}
},
recall: func() {
me._noneActive = 1;
me._recallCounter = 0;
foreach (var w; warnings.vector) {
if (w.clearFlag == 1) {
@ -302,9 +323,13 @@ var ECAM_controller = {
w.clearFlag = 0;
me._recallCounter += 1;
}
if (w.active == 1) {
me._noneActive = 0;
}
}
if (me._recallCounter == 0) {
if (me._recallCounter == 0 and me._noneActive) {
FWC.Btn.recallStsNormal.setValue(1);
settimer(func() {
if (FWC.Btn.recallStsNormal.getValue() == 1) { # catch unexpected error, trying something new here
@ -319,6 +344,9 @@ var ECAM_controller = {
warning.active = 0;
warning.noRepeat = 0;
warning.noRepeat2 = 0;
if (warning.aural == 2) {
aural[2].setValue(0);
}
},
};

View file

@ -10,7 +10,7 @@ var apWarn = props.globals.getNode("/it-autoflight/output/ap-warning", 1);
var athrWarn = props.globals.getNode("/it-autoflight/output/athr-warning", 1);
var emerGen = props.globals.getNode("/controls/electrical/switches/emer-gen", 1);
var fac1Node = props.globals.getNode("/controls/fctl/fac1", 1);
var fac1Node = props.globals.getNode("/controls/fctl/switches/fac1", 1);
var state1Node = props.globals.getNode("/engines/engine[0]/state", 1);
var state2Node = props.globals.getNode("/engines/engine[1]/state", 1);
var wowNode = props.globals.getNode("/fdm/jsbsim/position/wow", 1);
@ -21,6 +21,7 @@ var apu_bleedSw = props.globals.getNode("/controls/pneumatic/switches/bleedapu
var gear = props.globals.getNode("/gear/gear-pos-norm", 1);
var cutoff1 = props.globals.getNode("/controls/engines/engine[0]/cutoff-switch", 1);
var cutoff2 = props.globals.getNode("/controls/engines/engine[1]/cutoff-switch", 1);
var stallVoice = props.globals.initNode("/sim/sound/warnings/stall-voice", 0, "BOOL");
var engOpt = props.globals.getNode("/options/eng", 1);
# local variables
@ -28,11 +29,53 @@ var phaseVar = nil;
var dualFailFACActive = 1;
var emerConfigFACActive = 1;
var gear_agl_cur = nil;
var messages_priority_3 = func {
phaseVar = phaseNode.getValue();
# FCTL
# Stall
# todo - altn law and emer cancel flipflops page 2440
if (phaseVar >= 5 and phaseVar <= 7 and (getprop("/fdm/jsbsim/fcs/slat-pos-deg") <= 15 and (getprop("/systems/navigation/adr/output/aoa-1") > 15 or getprop("/systems/navigation/adr/output/aoa-2") > 15 or getprop("/systems/navigation/adr/output/aoa-3") > 15)) or (getprop("/fdm/jsbsim/fcs/slat-pos-deg") > 15 and (getprop("/systems/navigation/adr/output/aoa-1") > 23 or getprop("/systems/navigation/adr/output/aoa-2") > 23 or getprop("/systems/navigation/adr/output/aoa-3") > 23))) {
stall.active = 1;
} else {
ECAM_controller.warningReset(stall);
}
if (stall.active) {
stallVoice.setValue(1);
} else {
stallVoice.setValue(0);
}
if ((phaseVar == 1 or (phaseVar >= 5 and phaseVar <= 7)) and getprop("/systems/navigation/adr/output/overspeed")) {
overspeed.active = 1;
if (getprop("/systems/navigation/adr/computation/overspeed-vmo") or getprop("/systems/navigation/adr/computation/overspeed-mmo")) {
overspeedVMO.active = 1;
} else {
ECAM_controller.warningReset(overspeedVMO);
}
if (getprop("/systems/navigation/adr/computation/overspeed-vle")) {
overspeedGear.active = 1;
} else {
ECAM_controller.warningReset(overspeedGear);
}
if (getprop("/systems/navigation/adr/computation/overspeed-vfe")) {
overspeedFlap.active = 1;
overspeedFlap.msg = "-VFE................" ~ (systems.ADIRSnew.overspeedVFE.getValue() - 4);
} else {
ECAM_controller.warningReset(overspeedFlap);
overspeedFlap.msg = "-VFE................XXX";
}
} else {
ECAM_controller.warningReset(overspeed);
ECAM_controller.warningReset(overspeedVMO);
ECAM_controller.warningReset(overspeedGear);
ECAM_controller.warningReset(overspeedFlap);
overspeedFlap.msg = "-VFE................XXX";
}
# FCTL FLAPS NOT ZERO
if ((flap_not_zero.clearFlag == 0) and phaseVar == 6 and getprop("/controls/flight/flap-lever") != 0 and getprop("/instrumentation/altimeter/indicated-altitude-ft") > 22000) {
flap_not_zero.active = 1;
} else {
@ -929,7 +972,7 @@ var messages_priority_3 = func {
var messages_priority_2 = func {
phaseVar = phaseNode.getValue();
# DC EMER CONFIG
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dcEss.getValue() < 25 and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8 and dcEmerconfig.clearFlag == 0) {
dcEmerconfig.active = 1;
dcEmerconfigManOn.active = 1;
} else {
@ -937,7 +980,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(dcEmerconfigManOn);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() < 25 and phaseVar != 4 and phaseVar != 8 and dcBus12Fault.clearFlag == 0) {
dcBus12Fault.active = 1;
dcBus12FaultBlower.active = 1;
dcBus12FaultExtract.active = 1;
@ -953,7 +996,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(dcBus12FaultBrking);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.acEss.getValue() < 110 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.acEss.getValue() < 110 and phaseVar != 4 and phaseVar != 8 and AcBusEssFault.clearFlag == 0) {
AcBusEssFault.active = 1;
if (!systems.ELEC.Switch.acEssFeed.getBoolValue()) {
AcBusEssFaultFeed.active = 1;
@ -967,7 +1010,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(AcBusEssFaultAtc);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac1.getValue() < 110 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac1.getValue() < 110 and phaseVar != 4 and phaseVar != 8 and AcBus1Fault.clearFlag == 0) {
AcBus1Fault.active = 1;
AcBus1FaultBlower.active = 1;
} else {
@ -975,7 +1018,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(AcBus1FaultBlower);
}
if (!dcEmerconfig.active and systems.ELEC.Bus.dcEss.getValue() < 25 and phaseVar != 4 and phaseVar != 8) {
if (!dcEmerconfig.active and systems.ELEC.Bus.dcEss.getValue() < 25 and phaseVar != 4 and phaseVar != 8 and DcEssBusFault.clearFlag == 0) {
DcEssBusFault.active = 1;
DcEssBusFaultRadio.active = 1;
DcEssBusFaultRadio2.active = 1;
@ -989,7 +1032,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(DcEssBusFaultGPWS);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac2.getValue() < 110 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.ac2.getValue() < 110 and phaseVar != 4 and phaseVar != 8 and AcBus2Fault.clearFlag == 0) {
AcBus2Fault.active = 1;
AcBus2FaultExtract.active = 1;
} else {
@ -997,7 +1040,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(AcBus2FaultExtract);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() >= 25 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() < 25 and systems.ELEC.Bus.dc2.getValue() >= 25 and phaseVar != 4 and phaseVar != 8 and dcBus1Fault.clearFlag == 0) {
dcBus1Fault.active = 1;
dcBus1FaultBlower.active = 1;
dcBus1FaultExtract.active = 1;
@ -1007,7 +1050,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(dcBus1FaultExtract);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() >= 25 and systems.ELEC.Bus.dc2.getValue() <= 25 and phaseVar != 4 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and systems.ELEC.Bus.dc1.getValue() >= 25 and systems.ELEC.Bus.dc2.getValue() <= 25 and phaseVar != 4 and phaseVar != 8 and dcBus2Fault.clearFlag == 0) {
dcBus2Fault.active = 1;
dcBus2FaultAirData.active = 1;
dcBus2FaultBaro.active = 1;
@ -1017,13 +1060,13 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(dcBus2FaultBaro);
}
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dcBat.getValue() < 25 and phaseVar != 4 and phaseVar != 5 and phaseVar != 7 and phaseVar != 8) {
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !dcEmerconfig.active and systems.ELEC.Bus.dcBat.getValue() < 25 and phaseVar != 4 and phaseVar != 5 and phaseVar != 7 and phaseVar != 8 and dcBusBatFault.clearFlag == 0) {
dcBusBatFault.active = 1;
} else {
ECAM_controller.warningReset(dcBusBatFault);
}
if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.dcEssShed.getValue() < 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and phaseVar != 4 and phaseVar != 8) {
if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.dcEssShed.getValue() < 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and phaseVar != 4 and phaseVar != 8 and dcBusEssShed.clearFlag == 0) {
dcBusEssShed.active = 1;
dcBusEssShedExtract.active = 1;
dcBusEssShedIcing.active = 1;
@ -1033,7 +1076,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(dcBusEssShedIcing);
}
if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.acEssShed.getValue() < 110 and systems.ELEC.Bus.acEss.getValue() >= 110 and phaseVar != 4 and phaseVar != 8) {
if (!(getprop("/systems/electrical/some-electric-thingie/emer-elec-config") and !getprop("/systems/electrical/relay/emer-glc/contact-pos")) and systems.ELEC.Bus.acEssShed.getValue() < 110 and systems.ELEC.Bus.acEss.getValue() >= 110 and phaseVar != 4 and phaseVar != 8 and acBusEssShed.clearFlag == 0) {
acBusEssShed.active = 1;
if (!getprop("/systems/electrical/some-electric-thingie/emer-elec-config")) {
acBusEssShedAtc.active = 1;
@ -1045,7 +1088,13 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(acBusEssShedAtc);
}
if (fcu.FCUController.FCU1.failed and fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and systems.ELEC.Bus.dcEss.getValue() >= 25) {
if (getprop("/instrumentation/tcas/serviceable") == 0 and phaseVar != 3 and phaseVar != 4 and phaseVar != 7 and systems.ELEC.Bus.ac1.getValue() and pts.Instrumentation.TCAS.Inputs.mode.getValue() != 1 and tcasFault.clearFlag == 0) {
tcasFault.active = 1;
} else {
ECAM_controller.warningReset(tcasFault);
}
if (fcu.FCUController.FCU1.failed and fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and systems.ELEC.Bus.dcEss.getValue() >= 25 and fcuFault.clearFlag == 0) {
fcuFault.active = 1;
fcuFaultBaro.active = 1;
} else {
@ -1053,7 +1102,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(fcuFaultBaro);
}
if (fcu.FCUController.FCU1.failed and !fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25) {
if (fcu.FCUController.FCU1.failed and !fcu.FCUController.FCU2.failed and systems.ELEC.Bus.dcEss.getValue() >= 25 and fcuFault1.clearFlag == 0) {
fcuFault1.active = 1;
fcuFault1Baro.active = 1;
} else {
@ -1061,7 +1110,7 @@ var messages_priority_2 = func {
ECAM_controller.warningReset(fcuFault1Baro);
}
if (fcu.FCUController.FCU2.failed and !fcu.FCUController.FCU1.failed and systems.ELEC.Bus.dc2.getValue() >= 25) {
if (fcu.FCUController.FCU2.failed and !fcu.FCUController.FCU1.failed and systems.ELEC.Bus.dc2.getValue() >= 25 and fcuFault2.clearFlag == 0) {
fcuFault2.active = 1;
fcuFault2Baro.active = 1;
} else {
@ -1573,7 +1622,7 @@ var messages_right_memo = func {
}
# Listeners
setlistener("/controls/fctl/fac1", func() {
setlistener("/controls/fctl/switches/fac1", func() {
if (dualFail.active == 0 and emerconfig.active == 0) { return; }
if (fac1Node.getBoolValue() and dualFail.active == 1) {

View file

@ -10,8 +10,14 @@
# Left E/WD
var warnings = std.Vector.new([
var stall = warning.new(msg: "", aural: 2),
var flap_not_zero = warning.new(msg: "F/CTL FLAP LVR NOT ZERO", colour: "r", aural: 0, light: 0),
var overspeed = warning.new(msg: "OVER SPEED", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var overspeedVMO = warning.new(msg: "-VMO/MMO.......350 /.82", colour: "r"),
var overspeedGear = warning.new(msg: "-VLE...........280 /.67", colour: "r"),
var overspeedFlap = warning.new(msg: "-VFE................XXX", colour: "r"),
# DUAL ENG FAIL
var dualFail = warning.new(msg: "ENG DUAL FAILURE", colour: "r", aural: 0, light: 0, hasSubmsg: 1),
var dualFailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
@ -118,11 +124,11 @@ var warnings = std.Vector.new([
# Autopilot
var ap_offw = warning.new(msg: "AUTO FLT AP OFF", colour: "r", light: 0),
var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", colour: "a", aural: 1, light: 1),
var athr_offw = warning.new(msg: "AUTO FLT A/THR OFF", colour: "a", aural: 1, light: 1, hasSubmsg: 1),
var athr_offw_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"),
var athr_lock = warning.new(msg: "ENG THRUST LOCKED", colour: "a", aural: 1, light: 1),
var athr_lock = warning.new(msg: "ENG THRUST LOCKED", colour: "a", aural: 1, light: 1, hasSubmsg: 1),
var athr_lock_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"),
var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", colour: "a", aural: 1, light: 1),
var athr_lim = warning.new(msg: "AUTO FLT A/THR LIMITED", colour: "a", aural: 1, light: 1, hasSubmsg: 1),
var athr_lim_1 = warning.new(msg: "-THR LEVERS........MOVE", colour: "c"),
# Cargo smoke
@ -215,6 +221,9 @@ var warnings = std.Vector.new([
var acBusEssShed = warning.new(msg: "ELEC DC ESS BUS SHED", colour: "a", aural: 1, light: 1),
var acBusEssShedAtc = warning.new(msg: " -ATC..............SYS 2", colour: "c"),
# TCAS FAULT
var tcasFault = warning.new(msg: "NAV TCAS FAULT", colour: "a", aural: 1, light: 1),
# FCU fault
var fcuFault = warning.new(msg: "AUTO FLT FCU 1+2 FAULT", colour: "a", aural: 1, light: 1, hasSubmsg: 1),
var fcuFaultBaro = warning.new(msg: " -PFD BARO REF: STD ONLY", colour: "c"),
@ -239,7 +248,6 @@ var warnings = std.Vector.new([
var apuLoopBFault = warning.new(msg: "APU FIRE LOOP B FAULT", colour: "a"),
var crgFwdFireDetFault = warning.new(msg: "FWD CRG DET FAULT", colour: "a"),
var crgAftFireDetFault = warning.new(msg: "AFT CRG DET FAULT", colour: "a"),
# Recall
var recallNormal = warning.new(msg: " ", colour: "g", hasSubmsg: 1),
var recallNormal1 = warning.new(msg: " ", colour: "g", hasSubmsg: 1),

View file

@ -5,84 +5,178 @@
# If All ELACs Fail, Alternate Law
setprop("/it-fbw/roll-back", 0);
setprop("/it-fbw/spd-hold", 0);
setprop("/it-fbw/protections/overspeed", 0);
setprop("/it-fbw/protections/overspeed-roll-back", 0);
setprop("/it-fbw/speeds/vmo-mmo", 350);
var mmoIAS = 0;
var fctlInit = func {
setprop("/controls/fctl/elac1", 1);
setprop("/controls/fctl/elac2", 1);
setprop("/controls/fctl/sec1", 1);
setprop("/controls/fctl/sec2", 1);
setprop("/controls/fctl/sec3", 1);
setprop("/controls/fctl/fac1", 1);
setprop("/controls/fctl/fac2", 1);
setprop("/systems/fctl/elac1", 0);
setprop("/systems/fctl/elac2", 0);
setprop("/systems/fctl/sec1", 0);
setprop("/systems/fctl/sec2", 0);
setprop("/systems/fctl/sec3", 0);
setprop("/systems/fctl/fac1", 0);
setprop("/systems/fctl/fac2", 0);
setprop("/it-fbw/degrade-law", 0);
setprop("/it-fbw/override", 0);
setprop("/it-fbw/law", 0);
updatet.start();
fbwt.start();
}
var elac1_sw = 0;
var elac2_sw = 0;
var sec1_sw = 0;
var sec2_sw = 0;
var sec3_sw = 0;
var fac1_sw = 0;
var fac2_sw = 0;
var elac1_fail = 0;
var elac2_fail = 0;
var sec1_fail = 0;
var sec2_fail = 0;
var sec3_fail = 0;
var fac1_fail = 0;
var fac2_fail = 0;
var ac_ess = 0;
var dc_ess = 0;
var dc_ess_shed = 0;
var ac1 = 0;
var ac2 = 0;
var dc1 = 0;
var dc2 = 0;
var dcHot1 = 0;
var dcHot2 = 0;
var blue = 0;
var green = 0;
var yellow = 0;
var ail = 0;
var roll = 0;
var rollback = 0;
var battery1_sw = 0;
var battery2_sw = 0;
var law = 0;
var FBW = {
degradeLaw: props.globals.getNode("/it-fbw/degrade-law"),
activeLaw: props.globals.getNode("/it-fbw/law"),
override: props.globals.getNode("/it-fbw/override"),
rollBack: props.globals.getNode("/it-fbw/roll-back"),
rollLim: props.globals.getNode("/it-fbw/roll-lim"),
Computers: {
elac1: props.globals.getNode("/systems/fctl/elac1"),
elac2: props.globals.getNode("/systems/fctl/elac2"),
sec1: props.globals.getNode("/systems/fctl/sec1"),
sec2: props.globals.getNode("/systems/fctl/sec2"),
sec3: props.globals.getNode("/systems/fctl/sec3"),
fac1: props.globals.getNode("/systems/fctl/fac1"),
fac2: props.globals.getNode("/systems/fctl/fac2"),
},
Failures: {
elac1: props.globals.getNode("/systems/failures/fctl/elac1"),
elac2: props.globals.getNode("/systems/failures/fctl/elac2"),
sec1: props.globals.getNode("/systems/failures/fctl/sec1"),
sec2: props.globals.getNode("/systems/failures/fctl/sec2"),
sec3: props.globals.getNode("/systems/failures/fctl/sec3"),
fac1: props.globals.getNode("/systems/failures/fctl/fac1"),
fac2: props.globals.getNode("/systems/failures/fctl/fac2"),
},
Lights: {
elac1: props.globals.getNode("/controls/fctl/lights/elac1-fault"),
elac2: props.globals.getNode("/controls/fctl/lights/elac2-fault"),
sec1: props.globals.getNode("/controls/fctl/lights/sec1-fault"),
sec2: props.globals.getNode("/controls/fctl/lights/sec2-fault"),
sec2: props.globals.getNode("/controls/fctl/lights/sec3-fault"),
fac1: props.globals.getNode("/controls/fctl/lights/fac1-fault"),
fac2: props.globals.getNode("/controls/fctl/lights/fac2-fault"),
},
Protections: {
overspeedRoll: props.globals.getNode("/it-fbw/protections/overspeed-roll-back"),
},
Switches: {
elac1Sw: props.globals.getNode("/controls/fctl/switches/elac1"),
elac2Sw: props.globals.getNode("/controls/fctl/switches/elac2"),
sec1Sw: props.globals.getNode("/controls/fctl/switches/sec1"),
sec2Sw: props.globals.getNode("/controls/fctl/switches/sec2"),
sec3Sw: props.globals.getNode("/controls/fctl/switches/sec3"),
fac1Sw: props.globals.getNode("/controls/fctl/switches/fac1"),
fac2Sw: props.globals.getNode("/controls/fctl/switches/fac2"),
},
init: func() {
if (updatet.isRunning) {
updatet.stop();
}
if (fbwt.isRunning) {
fbwt.stop();
}
me.resetFail();
me.Switches.elac1Sw.setBoolValue(1);
me.Switches.elac2Sw.setBoolValue(1);
me.Switches.sec1Sw.setBoolValue(1);
me.Switches.sec2Sw.setBoolValue(1);
me.Switches.sec3Sw.setBoolValue(1);
me.Switches.fac1Sw.setBoolValue(1);
me.Switches.fac2Sw.setBoolValue(1);
me.Computers.elac1.setBoolValue(0);
me.Computers.elac2.setBoolValue(0);
me.Computers.sec1.setBoolValue(0);
me.Computers.sec2.setBoolValue(0);
me.Computers.sec3.setBoolValue(0);
me.Computers.fac1.setBoolValue(0);
me.Computers.fac2.setBoolValue(0);
me.degradeLaw.setValue(0);
me.activeLaw.setValue(0);
me.override.setValue(0);
if (!updatet.isRunning) {
updatet.start();
}
if (!fbwt.isRunning) {
fbwt.start();
}
},
resetFail: func() {
me.Failures.elac1.setBoolValue(0);
me.Failures.elac2.setBoolValue(0);
me.Failures.sec1.setBoolValue(0);
me.Failures.sec2.setBoolValue(0);
me.Failures.sec3.setBoolValue(0);
me.Failures.fac1.setBoolValue(0);
me.Failures.fac2.setBoolValue(0);
},
};
var update_loop = func {
var elac1_sw = getprop("/controls/fctl/elac1");
var elac2_sw = getprop("/controls/fctl/elac2");
var sec1_sw = getprop("/controls/fctl/sec1");
var sec2_sw = getprop("/controls/fctl/sec2");
var sec3_sw = getprop("/controls/fctl/sec3");
var fac1_sw = getprop("/controls/fctl/fac1");
var fac2_sw = getprop("/controls/fctl/fac2");
elac1_sw = FBW.Switches.elac1Sw.getValue();
elac2_sw = FBW.Switches.elac2Sw.getValue();
sec1_sw = FBW.Switches.sec1Sw.getValue();
sec2_sw = FBW.Switches.sec2Sw.getValue();
sec3_sw = FBW.Switches.sec3Sw.getValue();
fac1_sw = FBW.Switches.fac1Sw.getValue();
fac2_sw = FBW.Switches.fac2Sw.getValue();
var elac1_fail = getprop("/systems/failures/elac1");
var elac2_fail = getprop("/systems/failures/elac2");
var sec1_fail = getprop("/systems/failures/sec1");
var sec2_fail = getprop("/systems/failures/sec2");
var sec3_fail = getprop("/systems/failures/sec3");
var fac1_fail = getprop("/systems/failures/fac1");
var fac2_fail = getprop("/systems/failures/fac2");
elac1_fail = FBW.Failures.elac1.getValue();
elac2_fail = FBW.Failures.elac2.getValue();
sec1_fail = FBW.Failures.sec1.getValue();
sec2_fail = FBW.Failures.sec2.getValue();
sec3_fail = FBW.Failures.sec3.getValue();
fac1_fail = FBW.Failures.fac1.getValue();
fac2_fail = FBW.Failures.fac2.getValue();
var ac_ess = props.globals.getNode("/systems/electrical/bus/ac-ess").getValue();
var dc_ess = props.globals.getNode("/systems/electrical/bus/dc-ess").getValue();
var dc_ess_shed = props.globals.getNode("/systems/electrical/bus/dc-ess-shed").getValue();
var ac1 = props.globals.getNode("/systems/electrical/bus/ac-1").getValue();
var ac2 = props.globals.getNode("/systems/electrical/bus/ac-2").getValue();
var dc1 = props.globals.getNode("/systems/electrical/bus/dc-1").getValue();
var dc2 = props.globals.getNode("/systems/electrical/bus/dc-2").getValue();
var battery1_sw = props.globals.getNode("/controls/electrical/switches/bat-1").getValue();
var battery2_sw = props.globals.getNode("/controls/electrical/switches/bat-2").getValue();
var elac1_test = getprop("/systems/electrical/elac1-test");
var elac2_test = getprop("/systems/electrical/elac2-test");
ac_ess = systems.ELEC.Bus.acEss.getValue();
dc_ess = systems.ELEC.Bus.dcEss.getValue();
dc_ess_shed = systems.ELEC.Bus.dcEssShed.getValue();
ac1 = systems.ELEC.Bus.ac1.getValue();
ac2 = systems.ELEC.Bus.ac2.getValue();
dc1 = systems.ELEC.Bus.dc1.getValue();
dc2 = systems.ELEC.Bus.dc2.getValue();
dcHot1 = systems.ELEC.Bus.dcHot1.getValue();
dcHot2 = systems.ELEC.Bus.dcHot2.getValue();
battery1_sw = systems.ELEC.Switch.bat1.getValue();
battery2_sw = systems.ELEC.Switch.bat2.getValue();
if (elac1_sw and !elac1_fail and (dc_ess >= 25 or battery1_sw) and !elac1_test) {
setprop("/systems/fctl/elac1", 1);
setprop("/systems/failures/elac1-fault", 0);
} else if (elac1_sw and (elac1_fail or (dc_ess < 25 and !battery1_sw)) and !elac1_test) {
setprop("/systems/failures/elac1-fault", 1);
setprop("/systems/fctl/elac1", 0);
} else if (!elac1_test) {
setprop("/systems/failures/elac1-fault", 0);
setprop("/systems/fctl/elac1", 1);
if (elac1_sw and !elac1_fail and (dc_ess >= 25 or dcHot1 >= 25)) {
FBW.Computers.elac1.setValue(1);
FBW.Lights.elac1.setValue(0);
} else if (elac1_sw and (elac1_fail or (dc_ess < 25 and dcHot1 < 25))) {
FBW.Computers.elac1.setValue(0);
FBW.Lights.elac1.setValue(1);
}
if (elac2_sw and !elac2_fail and (dc2 >= 25 or battery2_sw) and !elac2_test) {
setprop("/systems/fctl/elac2", 1);
setprop("/systems/failures/elac2-fault", 0);
} else if (elac2_sw and (elac2_fail or (dc2 < 25 and !battery2_sw)) and !elac2_test) {
setprop("/systems/failures/elac2-fault", 1);
setprop("/systems/fctl/elac2", 0);
} else if (!elac2_test) {
setprop("/systems/failures/elac2-fault", 0);
setprop("/systems/fctl/elac2", 1);
if (elac2_sw and !elac2_fail and (dc2 >= 25 or dcHot2 >= 25)) {
FBW.Computers.elac2.setValue(1);
FBW.Lights.elac2.setValue(0);
} else if (elac1_sw and (elac2_fail or (dc2 < 25 and dcHot2 < 25))) {
FBW.Computers.elac2.setValue(0);
FBW.Lights.elac2.setValue(1);
}
if (sec1_sw and !sec1_fail and ac_ess >= 110) {
@ -165,37 +259,40 @@ var update_loop = func {
var sec3 = getprop("/systems/fctl/sec3");
var fac1 = getprop("/systems/fctl/fac1");
var fac2 = getprop("/systems/fctl/fac2");
var law = getprop("/it-fbw/law");
law = FBW.activeLaw.getValue();
# Degrade logic, all failures which degrade FBW need to go here. -JD
blue = systems.HYD.Psi.blue.getValue();
green = systems.HYD.Psi.green.getValue();
yellow = systems.HYD.Psi.yellow.getValue();
if (getprop("/gear/gear[1]/wow") == 0 and getprop("/gear/gear[2]/wow") == 0) {
if (!elac1 and !elac2) {
if (law == 0) {
setprop("/it-fbw/degrade-law", 1);
FBW.degradeLaw.setValue(1);
}
}
if (ac_ess >= 110 and getprop("/systems/hydraulic/blue-psi") >= 1500 and getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/systems/hydraulic/yellow-psi") < 1500) {
if (ac_ess >= 110 and blue >= 1500 and green < 1500 and yellow < 1500) {
if (law == 0 or law == 1) {
setprop("/it-fbw/degrade-law", 2);
FBW.degradeLaw.setValue(2);
}
}
if (ac_ess < 110 or (getprop("/systems/hydraulic/blue-psi") < 1500 and getprop("/systems/hydraulic/green-psi") < 1500 and getprop("/systems/hydraulic/yellow-psi") < 1500)) {
setprop("/it-fbw/degrade-law", 3);
if (ac_ess < 110 or (blue < 1500 and green < 1500 and yellow < 1500)) {
FBW.degradeLaw.setValue(3);
}
}
if (getprop("/controls/gear/gear-down") == 1 and getprop("/it-autoflight/output/ap1") == 0 and getprop("/it-autoflight/output/ap2") == 0) {
if (law == 1) {
setprop("/it-fbw/degrade-law", 2);
FBW.degradeLaw.setValue(2);
}
}
# degrade loop runs faster; reset this variable
var law = getprop("/it-fbw/law");
law = FBW.activeLaw.getValue();
# Mech Backup can always return to direct, if it can.
if (law == 3 and ac_ess >= 110 and (getprop("/systems/hydraulic/green-psi") >= 1500 or getprop("/systems/hydraulic/blue-psi") >= 1500 or getprop("/systems/hydraulic/yellow-psi") >= 1500)) {
setprop("/it-fbw/degrade-law", 2);
if (law == 3 and ac_ess >= 110 and (green >= 1500 or blue >= 1500 or yellow >= 1500)) {
FBW.degradeLaw.setValue(2);
}
mmoIAS = (getprop("/instrumentation/airspeed-indicator/indicated-speed-kt") / getprop("/instrumentation/airspeed-indicator/indicated-mach")) * 0.82;
@ -220,59 +317,60 @@ var update_loop = func {
}
var fbw_loop = func {
var ail = getprop("/controls/flight/aileron");
ail = pts.Controls.Flight.aileron.getValue();
roll = pts.Orientation.roll.getValue();
rollback = FBW.rollBack.getValue();
if (ail > 0.4 and getprop("/orientation/roll-deg") >= -33.5) {
setprop("/it-fbw/roll-lim", "67");
if (getprop("/it-fbw/roll-back") == 1 and getprop("/orientation/roll-deg") <= 33.5 and getprop("/orientation/roll-deg") >= -33.5) {
setprop("/it-fbw/roll-back", 0);
if (ail > 0.4 and roll >= -33.5) {
FBW.rollLim.setValue("67");
if (rollback == 1 and roll <= 33.5 and roll >= -33.5) {
FBW.rollBack.setValue(0);
} elsif (rollback == 0 and (roll > 33.5 or roll < -33.5)) {
FBW.rollBack.setValue(1);
}
if (getprop("/it-fbw/roll-back") == 0 and (getprop("/orientation/roll-deg") > 33.5 or getprop("/orientation/roll-deg") < -33.5)) {
setprop("/it-fbw/roll-back", 1);
}
} else if (ail < -0.4 and getprop("/orientation/roll-deg") <= 33.5) {
setprop("/it-fbw/roll-lim", "67");
if (getprop("/it-fbw/roll-back") == 1 and getprop("/orientation/roll-deg") <= 33.5 and getprop("/orientation/roll-deg") >= -33.5) {
setprop("/it-fbw/roll-back", 0);
}
if (getprop("/it-fbw/roll-back") == 0 and (getprop("/orientation/roll-deg") > 33.5 or getprop("/orientation/roll-deg") < -33.5)) {
setprop("/it-fbw/roll-back", 1);
} else if (ail < -0.4 and roll <= 33.5) {
FBW.rollLim.setValue("67");
if (rollback == 1 and roll <= 33.5 and roll >= -33.5) {
FBW.rollBack.setValue(0);
} elsif (rollback == 0 and (roll > 33.5 or roll < -33.5)) {
FBW.rollBack.setValue(1);
}
} else if (ail < 0.04 and ail > -0.04) {
setprop("/it-fbw/roll-lim", "33");
if (getprop("/it-fbw/roll-back") == 1 and getprop("/orientation/roll-deg") <= 33.5 and getprop("/orientation/roll-deg") >= -33.5) {
setprop("/it-fbw/roll-back", 0);
FBW.rollLim.setValue("33");
if (rollback == 1 and roll <= 33.5 and roll >= -33.5) {
FBW.rollBack.setValue(0);
}
}
if (ail > 0.04 or ail < -0.04) {
setprop("/it-fbw/protections/overspeed-roll-back", 0);
FBW.Protections.overspeedRoll.setValue(0);
} else if (ail < 0.04 and ail > -0.04) {
setprop("/it-fbw/protections/overspeed-roll-back", 1);
FBW.Protections.overspeedRoll.setValue(1);
}
if (getprop("/it-fbw/override") == 0) {
var degrade = getprop("/it-fbw/degrade-law");
var active = FBW.activeLaw.getValue();
var degrade = FBW.degradeLaw.getValue();
if (degrade == 0) {
if (getprop("/it-fbw/law") != 0) {
setprop("/it-fbw/law", 0);
if (active != 0) {
FBW.activeLaw.setValue(0);
}
} else if (degrade == 1) {
if (getprop("/it-fbw/law") != 1) {
setprop("/it-fbw/law", 1);
if (active != 1) {
FBW.activeLaw.setValue(1);
}
} else if (degrade == 2) {
if (getprop("/it-fbw/law") != 2) {
setprop("/it-fbw/law", 2);
if (active != 2) {
FBW.activeLaw.setValue(2);
}
} else if (degrade == 3) {
if (getprop("/it-fbw/law") != 3) {
setprop("/it-fbw/law", 3);
if (active != 3) {
FBW.activeLaw.setValue(3);
}
}
}
if (getprop("/it-fbw/law") != 0) {
if (FBW.activeLaw.getValue() != 0) {
if (getprop("/it-autoflight/output/ap1") == 1 or getprop("/it-autoflight/output/ap2") == 1) {
fcu.apOff("hard", 0);
}

View file

@ -58,6 +58,7 @@ var FCU = {
var FCUController = {
FCU1: nil,
FCU2: nil,
activeFMGC: props.globals.getNode("/FMGC/active-fmgc-channel"),
FCUworking: 0,
_init: 0,
init: func() {
@ -77,7 +78,19 @@ var FCUController = {
} else {
me.FCUworking = 0;
}
notification = nil;
foreach (var update_item; me.update_items) {
update_item.update(notification);
}
},
update_items: [
props.UpdateManager.FromPropertyHashList(["/it-autoflight/output/fd1","/it-autoflight/output/fd2", "/it-autoflight/output/ap1", "/it-autoflight/output/ap2"], 1, func(notification)
{
updateActiveFMGC();
}
),
],
resetFail: func() {
if (me._init == 0) { return; }
me.FCU1.restore();
@ -103,7 +116,7 @@ var FCUController = {
},
ATHR: func() {
if (me.FCUworking) {
if (!athr.getBoolValue()) {
if (!athr.getBoolValue() and !pts.FMGC.CasCompare.rejectAll.getBoolValue()) {
athrInput.setValue(1);
} else {
athrOff("hard");
@ -441,6 +454,21 @@ var FCUController = {
},
};
# Master / slave principle of operation depending on the autopilot / flight director engagement
var updateActiveFMGC = func {
if (ap1.getBoolValue()) {
FCUController.activeFMGC.setValue(1);
} elsif (ap2.getBoolValue()) {
FCUController.activeFMGC.setValue(2);
} elsif (fd1.getBoolValue()) {
FCUController.activeFMGC.setValue(1);
} elsif (fd2.getBoolValue()) {
FCUController.activeFMGC.setValue(2);
} else {
FCUController.activeFMGC.setValue(1);
}
}
# Autopilot Disconnection
var apOff = func(type, side) {
if (side == 0) {

View file

@ -264,24 +264,24 @@ var masterFMGC = maketimer(0.2, func {
reset_FMGC();
}
if (getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") != 1024) {
setprop("/FMGC/internal/maxspeed", getprop("/systems/navigation/adr/computation/overspeed-vfe-spd") - 4);
} else {
setprop("/FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
}
flap = getprop("/controls/flight/flap-pos");
if (flap == 0) { # 0
setprop("/FMGC/internal/maxspeed", getprop("/it-fbw/speeds/vmo-mmo"));
setprop("/FMGC/internal/minspeed", 202);
} else if (flap == 1) { # 1
setprop("/FMGC/internal/maxspeed", 230);
setprop("/FMGC/internal/minspeed", 184);
} else if (flap == 2) { # 1+F
setprop("/FMGC/internal/maxspeed", 215);
setprop("/FMGC/internal/minspeed", 171);
} else if (flap == 3) { # 2
setprop("/FMGC/internal/maxspeed", 200);
setprop("/FMGC/internal/minspeed", 156);
} else if (flap == 4) { # 3
setprop("/FMGC/internal/maxspeed", 185);
setprop("/FMGC/internal/minspeed", 147);
} else if (flap == 5) { # FULL
setprop("/FMGC/internal/maxspeed", 177);
setprop("/FMGC/internal/minspeed", 131);
}

View file

@ -9,6 +9,9 @@ var guiModes = ['OFF', 'STANDBY', 'TEST', 'GROUND', 'ON', 'ALTITUDE'];
var guiNode = props.globals.getNode("/sim/gui/dialogs/radios/transponder-mode", 1);
var forLoopFlag = 0;
var altimeter = props.globals.initNode("/instrumentation/transponder/altimeter-input-src", 0, "INT");
var airspeed = props.globals.initNode("/instrumentation/transponder/airspeed-input-src", 0, "INT");
var Transponder = {
mode: 0,
code: "2000",
@ -97,6 +100,8 @@ var Transponder = {
return;
}
me.activeADIRS = newADIRS;
altimeter.setValue(newADIRS);
airspeed.setValue(newADIRS);
},
modeSwitch: func(newMode) {
me.mode = newMode;
@ -196,6 +201,8 @@ var transponderPanel = {
# update newly selected transponder
Transponders.vector[me.atcSel - 1].modeSwitch(me.modeSel);
me.atcFailLight(Transponders.vector[me.atcSel - 1].failed);
me.updateAirData();
},
modeSwitch: func(newMode) {
if (newMode < 0 or newMode > 5) {
@ -223,11 +230,27 @@ var transponderPanel = {
me.codeDisp = me.code;
me.codeProp.setValue(sprintf("%s", me.codeDisp));
Transponders.vector[me.atcSel - 1].setCode(me.code);
}
},
updateAirData: func() {
if (me.atcSel == 1) {
if (systems.SwitchingPanel.Switches.airData.getValue() == -1) {
Transponders.vector[0].switchADIRS(3);
} else {
Transponders.vector[0].switchADIRS(1);
}
} else {
if (systems.SwitchingPanel.Switches.airData.getValue() == 1) {
Transponders.vector[1].switchADIRS(3);
} else {
Transponders.vector[1].switchADIRS(2);
}
}
},
};
var init = func() {
transponderPanel.atcSwitch(1);
transponderPanel.updateAirData();
transponderTimer.start();
}

View file

@ -194,13 +194,14 @@ var triggerDoor = func(door, doorName, doorDesc) {
#######################
var systemsInit = func {
fbw.fctlInit();
fbw.FBW.init();
light_manager.init();
systems.ELEC.init();
systems.PNEU.init();
systems.HYD.init();
systems.FUEL.init();
systems.ADIRS.init();
systems.ADIRSnew.init();
systems.eng_init();
systems.fire_init();
systems.autobrake_init();
@ -220,6 +221,7 @@ var systemsInit = func {
ecam.ECAM_controller.init();
atc.init();
fcu.FCUController.init();
dmc.DMController.init();
}
setlistener("/sim/signals/fdm-initialized", func {
@ -232,11 +234,13 @@ var systemsLoop = maketimer(0.1, func {
systems.HYD.loop();
systems.FUEL.loop();
systems.ADIRS.loop();
systems.ADIRSnew.loop();
libraries.ECAM.loop();
libraries.BUTTONS.update();
fadec.FADEC.loop();
rmp.rmpUpdate();
fcu.FCUController.loop();
dmc.DMController.loop();
if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/electrical/ground-cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or (getprop("/controls/gear/brake-parking") == 0 and getprop("/services/chocks/nose") == 0 and getprop("/services/chocks/left") == 0 and getprop("/services/chocks/right") == 0))) {
setprop("/controls/electrical/ground-cart", 0);

View file

@ -30,6 +30,9 @@ var Controls = {
throttle: props.globals.getNode("/controls/engines/engine[1]/throttle"),
},
},
Flight: {
aileron: props.globals.getNode("/controls/flight/aileron"),
},
Gear: {
gearDown: props.globals.getNode("/controls/gear/gear-down"),
},
@ -54,6 +57,12 @@ var Engines = {
},
};
var FMGC = {
CasCompare: {
rejectAll: props.globals.getNode("/systems/fmgc/cas-compare/cas-reject-all"),
},
};
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")],
@ -63,6 +72,18 @@ var Instrumentation = {
AirspeedIndicator: {
indicatedSpdKt: props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt"),
},
TCAS: {
Inputs: {
mode: props.globals.getNode("/instrumentation/tcas/inputs/mode"),
},
},
};
var JSBSIM = {
FCS: {
flapDeg: props.globals.getNode("/fdm/jsbsim/fcs/flap-pos-deg"),
slatDeg: props.globals.getNode("/fdm/jsbsim/fcs/slat-pos-deg"),
},
};
var JSBSim = {
@ -98,6 +119,12 @@ var Sim = {
},
};
var Orientation = {
pitch: props.globals.getNode("/orientation/pitch-deg"),
roll: props.globals.getNode("/orientation/roll-deg"),
yaw: props.globals.getNode("/orientation/yaw-deg"),
};
var PTSSystems = {
Thrust: {
flex: props.globals.getNode("/systems/thrust/lim-flex"),

View file

@ -16,18 +16,9 @@ setprop("/controls/adirs/align-time", 600);
var ADIRS = {
init: func() {
setprop("/controls/adirs/numm", 0);
setprop("/instrumentation/adirs/adr[0]/active", 0);
setprop("/instrumentation/adirs/adr[1]/active", 0);
setprop("/instrumentation/adirs/adr[2]/active", 0);
setprop("/instrumentation/adirs/ir[0]/aligned", 0);
setprop("/instrumentation/adirs/ir[1]/aligned", 0);
setprop("/instrumentation/adirs/ir[2]/aligned", 0);
setprop("/controls/adirs/adr[0]/fault", 0);
setprop("/controls/adirs/adr[1]/fault", 0);
setprop("/controls/adirs/adr[2]/fault", 0);
setprop("/controls/adirs/adr[0]/off", 0);
setprop("/controls/adirs/adr[1]/off", 0);
setprop("/controls/adirs/adr[2]/off", 0);
setprop("/controls/adirs/ir[0]/align", 0);
setprop("/controls/adirs/ir[1]/align", 0);
setprop("/controls/adirs/ir[2]/align", 0);
@ -40,7 +31,6 @@ var ADIRS = {
setprop("/controls/adirs/ir[0]/fault", 0);
setprop("/controls/adirs/ir[1]/fault", 0);
setprop("/controls/adirs/ir[2]/fault", 0);
setprop("/controls/adirs/onbat", 0);
setprop("/controls/adirs/mcdu/mode1", ""); # INVAL ALIGN NAV ATT or off (blank)
setprop("/controls/adirs/mcdu/mode2", "");
setprop("/controls/adirs/mcdu/mode3", "");
@ -82,22 +72,6 @@ var ADIRS = {
me.stopAlign(2,1);
}
}
if (ac1 >= 110 or ac2 >= 110) {
pwr_src = "AC";
} else if (dcbat >= 25 and (getprop("/controls/adirs/ir[0]/knob") != 0 or getprop("/controls/adirs/ir[1]/knob") != 0 or getprop("/controls/adirs/ir[2]/knob") != 0)) {
pwr_src = "BATT";
} else {
pwr_src = "XX";
}
if (getprop("/controls/adirs/ir[0]/time") + 3 >= getprop("/sim/time/elapsed-sec") or getprop("/controls/adirs/ir[1]/time") + 3 >= getprop("/sim/time/elapsed-sec") or getprop("/controls/adirs/ir[2]/time") + 3 >= getprop("/sim/time/elapsed-sec")) {
setprop("/controls/adirs/onbat", 1);
} else if (pwr_src == "BATT") {
setprop("/controls/adirs/onbat", 1);
} else {
setprop("/controls/adirs/onbat", 0);
}
},
knob: func(k) {
knob = getprop("/controls/adirs/ir[" ~ k ~ "]/knob");
@ -141,7 +115,6 @@ var ADIRS = {
} else if (n == 2) {
alignThree.stop();
}
setprop("/instrumentation/adirs/adr[" ~ n ~ "]/active", 0);
setprop("/instrumentation/adirs/ir[" ~ n ~ "]/aligned", 0);
setprop("/controls/adirs/mcducbtn", 0);
},

264
Nasal/Systems/ADIRS/ADR.nas Normal file
View file

@ -0,0 +1,264 @@
# A3XX ADIRS System
# Jonathan Redpath (legoboyvdlp)
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
var _NUMADIRU = 3;
var _selfTestTime = nil;
var ADIRU = {
# local vars
_voltageMain: 0,
_voltageBackup: 0,
_voltageLimitedTime: 0,
_noPowerTime: 0,
_timeVar: 0,
num: 0,
outputOn: 0, # 0 = disc, 1 = normal
mode: 0, # 0 = off, 1 = nav, 2 = att
energised: 0, # 0 = off, 1 = on
operative: 0, # 0 = off,
input: [],
output: [],
# methods
new: func(n) {
var adiru = { parents:[ADIRU] };
adiru.num = n;
return adiru;
},
updateEnergised: func(mode) {
me.energised = mode != 0 ? 1 : 0;
},
updatePower: func(elec) {
me._voltageMain = elec.getValue() or 0;
return me._voltageMain;
},
updateBackupPower: func(elec, isLimited) {
me._voltageBackup = elec.getValue() or 0;
me._voltageLimitedTime = isLimited;
return me._voltageBackup;
},
selfTest: func() {
ADIRSnew._selfTest = 1;
_selfTestTime = pts.Sim.Time.elapsedSec.getValue();
ADIRSnew.Lights.adrOff[me.num].setValue(1);
ADIRSnew.Lights.adrFault[me.num].setValue(1);
settimer(func() {
ADIRSnew.Lights.adrOff[me.num].setValue(0);
ADIRSnew.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);
}, 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);
}, 1.1);
ADIRSnew.selfTest();
},
setOperative: func(newOperative) {
if (newOperative != me.operative) {
me.operative = newOperative;
if (newOperative) {
me.selfTest();
}
}
},
update: func() {
me._timeVar = pts.Sim.Time.elapsedSec.getValue();
if (me.energised and !me._voltageMain and me._voltageLimitedTime and me._noPowerTime == 0) {
me._noPowerTime = me._timeVar;
}
if (me.energised and me.mode) {
if (me._voltageMain) {
me._noPowerTime = 0;
me.setOperative(1);
if (!ADIRSnew._selfTest) {
ADIRSnew.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);
}
} else {
me._noPowerTime = 0;
me.setOperative(0);
if (!ADIRSnew._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0);
}
}
} else {
me._noPowerTime = 0;
me.setOperative(0);
if (!ADIRSnew._selfTest) {
ADIRSnew.Lights.onBat.setBoolValue(0);
}
}
},
};
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;
}
ADIRSnew.Lights.adrOff[n].setValue(ADIRSnew._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;
}
ADIRSnew.Lights.irOff[n].setValue(ADIRSnew._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);
}
}
};
var ADIRSnew = {
# local vars
_adrSwitchState: 0,
_irSwitchState: 0,
_irModeSwitchState: 0,
_hasPower: 0,
_cacheOperative: [0, 0, 0],
_cacheOutputOn: [0, 0, 0],
_flapPos: nil,
_slatPos: nil,
_selfTest: 0,
_init: 0,
# ADIRS Units
ADIRunits: [nil, nil, nil],
#IRunits: [nil, nil, nil],
# 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]],
# 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"),
},
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")],
},
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")],
},
# Nodes
overspeedVFE: props.globals.initNode("/systems/navigation/adr/computation/overspeed-vfe-spd", 0, "INT"),
# System
init: func() {
if (!me._init) {
for (i = 0; i < _NUMADIRU; i = i + 1) {
me.ADIRunits[i] = ADIRU.new(i);
me._init = 1;
}
}
},
update_items: [
props.UpdateManager.FromPropertyHashList(["/fdm/jsbsim/fcs/flap-pos-deg","/fdm/jsbsim/fcs/slat-pos-deg"], 0.1, func(notification)
{
me._flapPos = pts.JSBSIM.FCS.flapDeg.getValue();
me._slatPos = pts.JSBSIM.FCS.slatDeg.getValue();
if (me._flapPos >= 23 and me._slatPos >= 25) {
ADIRSnew.overspeedVFE.setValue(181);
} elsif (me._flapPos >= 18) {
ADIRSnew.overspeedVFE.setValue(189);
} elsif (me._flapPos >= 13 or me._slatPos > 20) {
ADIRSnew.overspeedVFE.setValue(204);
} elsif (me._slatPos <= 20 and me._flapPos > 2) {
ADIRSnew.overspeedVFE.setValue(219);
} elsif (me._slatPos >= 2 and me._slatPos <= 20) {
ADIRSnew.overspeedVFE.setValue(234);
} else {
ADIRSnew.overspeedVFE.setValue(1024);
}
}
),
],
loop: func() {
if (me._init) {
for (i = 0; i < _NUMADIRU; i = i + 1) {
# update ADR units power
me._hasPower = me.ADIRunits[i].updatePower(me.mainSupply[i]);
if (me._hasPower == 0) {
me.ADIRunits[i].updateBackupPower(me.backupSupply[i][0],me.backupSupply[i][1])
}
# Update ADR units
me.ADIRunits[i].update();
if (me.ADIRunits[i].operative != me._cacheOperative[i] or me.ADIRunits[i].outputOn != me._cacheOutputOn[i]) {
me._cacheOperative[i] = me.ADIRunits[i].operative;
me._cacheOutputOn[i] = me.ADIRunits[i].outputOn;
if (me.ADIRunits[i].outputOn) {
me.Operating.adr[i].setValue(me.ADIRunits[i].operative);
} else {
me.Operating.adr[i].setValue(0);
}
}
}
# Update VFE
notification = nil;
foreach (var update_item; me.update_items) {
update_item.update(notification);
}
}
},
selfTest: func() {
ADIRSnew.Lights.onBat.setBoolValue(1);
selfTestLoop.start();
},
};
setlistener("/systems/fmgc/cas-compare/cas-reject-all", func() {
if (pts.FMGC.CasCompare.rejectAll.getBoolValue()) {
fcu.athrOff("hard");
}
}, 0, 0);
selfTestLoop = maketimer(0.2, func() {
if (pts.Sim.Time.elapsedSec.getValue() > _selfTestTime + 5) {
ADIRSnew.Lights.onBat.setBoolValue(0);
selfTestLoop.stop();
ADIRSnew._selfTest = 0;
}
});

View file

@ -0,0 +1,32 @@
# A3XX Switching Panel
# Jonathan Redpath (legoboyvdlp)
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
var SwitchingPanel = {
Switches: {
attHdg: props.globals.getNode("/controls/navigation/switching/att-hdg"),
airData: props.globals.getNode("/controls/navigation/switching/air-data"),
eisDmc: props.globals.getNode("/controls/navigation/switching/eis-dmc"),
},
doAirData: func(newAirData) {
if (newAirData < -1 or newAirData > 1) { return; }
me.Switches.airData.setValue(newAirData);
atc.transponderPanel.updateAirData();
if (newAirData == -1) {
dmc.DMController.DMCs[0].changeActiveADIRS(2);
dmc.DMController.DMCs[1].changeActiveADIRS(1);
} elsif (newAirData == 1) {
dmc.DMController.DMCs[0].changeActiveADIRS(0);
dmc.DMController.DMCs[1].changeActiveADIRS(2);
} elsif (newAirData == 0) {
dmc.DMController.DMCs[0].changeActiveADIRS(0);
dmc.DMController.DMCs[1].changeActiveADIRS(1);
}
},
doEisDMC: func(newDMC) {
if (newDMC < -1 or newDMC > 1) { return; }
me.Switches.eisDMC.setValue(newDMC);
},
};

85
Nasal/Systems/DMC.nas Normal file
View file

@ -0,0 +1,85 @@
# A3XX Display System
# Jonathan Redpath (legoboyvdlp)
# Copyright (c) 2019 Jonathan Redpath (legoboyvdlp)
var DMC = {
_set: 0,
_setNil: 0,
activeADIRS: -9,
airspeeds: [props.globals.getNode("/systems/navigation/adr/output/cas-1", 1), props.globals.getNode("/systems/navigation/adr/output/cas-2", 1), props.globals.getNode("/systems/navigation/adr/output/cas-3", 1)],
altitudes: [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)],
machs: [props.globals.getNode("/systems/navigation/adr/output/mach-1", 1), props.globals.getNode("/systems/navigation/adr/output/mach-2", 1), props.globals.getNode("/systems/navigation/adr/output/mach-3", 1)],
altitudesPfd: [props.globals.getNode("/instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)],
sats: [props.globals.getNode("/systems/navigation/adr/output/sat-1", 1), props.globals.getNode("/systems/navigation/adr/output/sat-2", 1), props.globals.getNode("/systems/navigation/adr/output/sat-3", 1)],
tats: [props.globals.getNode("/systems/navigation/adr/output/tat-1", 1), props.globals.getNode("/systems/navigation/adr/output/tat-2", 1), props.globals.getNode("/systems/navigation/adr/output/tat-3", 1)],
outputs: [nil, nil, nil, nil, nil, nil], # airspeed, altitude, mach, pfd altitude, sat, tat
new: func(num) {
var d = { parents:[DMC] };
d.activeADIRS = num;
d.outputs = [nil, nil, nil, nil, nil, nil];
return d;
},
changeActiveADIRS: func(newADIRS) {
me.activeADIRS = newADIRS;
me._set = 0;
},
setOutputs: func(ADIRS) {
me.outputs[0] = me.airspeeds[ADIRS];
me.outputs[1] = me.altitudes[ADIRS];
me.outputs[2] = me.machs[ADIRS];
me.outputs[3] = me.altitudesPfd[ADIRS];
me.outputs[4] = me.sats[ADIRS];
me.outputs[5] = me.tats[ADIRS];
},
setOutputsNil: func() {
me.outputs[0] = nil;
me.outputs[1] = nil;
me.outputs[2] = nil;
me.outputs[3] = nil;
me.outputs[4] = nil;
me.outputs[5] = nil;
},
update: func() {
if (systems.ADIRSnew.ADIRunits[me.activeADIRS].operative and systems.ADIRSnew.ADIRunits[me.activeADIRS].outputOn) {
if (me._set != 1) {
me._setNil = 0;
me.setOutputs(me.activeADIRS);
me._setADIRS = me.activeADIRS;
me._set = 1;
}
} else {
if (me._setNil != 1) {
me._set = 0;
me.setOutputsNil();
me._setNil = 1;
}
}
},
};
var DMController = {
_init: 0,
i: nil, # to make sure scope remains local use me.i
DMCs: [nil, nil, nil],
init: func() {
if (!me._init) {
me.DMCs = [DMC.new(0), DMC.new(1), DMC.new(2)];
# update DMC2 to correct properties for first officer PFD
me.DMCs[1].altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)];
me.DMCs[1].altitudesPfd = [props.globals.getNode("/instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)];
me._init = 1;
}
},
loop: func() {
for (me.i = 0; me.i < 3; me.i = me.i + 1) {
me.DMCs[me.i].update();
}
},
};

View file

@ -24,6 +24,7 @@ var ELEC = {
dc1: props.globals.getNode("/systems/electrical/bus/dc-1"),
dc2: props.globals.getNode("/systems/electrical/bus/dc-2"),
dcHot1: props.globals.getNode("/systems/electrical/bus/dc-hot-1"),
dcHot2: props.globals.getNode("/systems/electrical/bus/dc-hot-2"),
},
Fail: {
acEssBusFault: props.globals.getNode("/systems/failures/electrical/ac-ess-bus"),

View file

@ -1581,14 +1581,32 @@
<max-dist>100</max-dist>
</crc>
<cricket>
<name>Cricket</name>
<path>Aircraft/A320-family/Sounds/Cockpit/cricket.wav</path>
<mode>looped</mode>
<type>avionics</type>
<condition>
<property>/sim/sound/warnings/cricket</property>
</condition>
<volume>
<factor>0.2</factor>
</volume>
<reference-dist>10</reference-dist>
<max-dist>100</max-dist>
</cricket>
<stall-voice>
<name>stall-voice</name>
<mode>looped</mode>
<path>Aircraft/A320-family/Sounds/Cockpit/stall_voice.wav</path>
<type>avionics</type>
<condition>
<property>warnings/stall/active</property>
<property>/sim/sound/warnings/stall-voice</property>
</condition>
<volume>
<factor>2.0</factor>
</volume>
<reference-dist>10</reference-dist>
<max-dist>100.0</max-dist>
</stall-voice>

Binary file not shown.

Binary file not shown.

1015
Systems/a320-adr.xml Normal file

File diff suppressed because it is too large Load diff

View file

@ -1348,8 +1348,8 @@
<test value="/systems/electrical/bus/dc-2">
/systems/electrical/bus/dc-2 ge 25
</test>
<output>/systems/electrical/outputs/adf</output>
<output>/systems/electrical/outputs/dme</output>
<!--<output>/systems/electrical/outputs/adf</output>
<output>/systems/electrical/outputs/dme</output>-->
<output>/systems/electrical/outputs/efis</output>
<output>/systems/electrical/outputs/fcp-power</output>
<output>/systems/electrical/outputs/fuel-pump[0]</output>
@ -1357,10 +1357,10 @@
<output>/systems/electrical/outputs/fuel-pump[2]</output>
<output>/systems/electrical/outputs/gps</output>
<output>/systems/electrical/outputs/mk-viii</output>
<output>/systems/electrical/outputs/nav[0]</output>
<!--<output>/systems/electrical/outputs/nav[0]</output>
<output>/systems/electrical/outputs/nav[1]</output>
<output>/systems/electrical/outputs/nav[2]</output>
<output>/systems/electrical/outputs/nav[3]</output>
<output>/systems/electrical/outputs/nav[3]</output>-->
<output>/systems/electrical/outputs/tacan</output>
<output>/systems/electrical/outputs/turn-coordinator</output>
</switch>
@ -1368,9 +1368,7 @@
<!-- Notes -->
<!-- Priority: eng, ext, apu but EXT ON lt stays on even when not feeding a/c -->
<!-- Ground service bus connected directly to input-volt -->
<!-- TR 2 fail leads to loss of gnd FLT bus -->
<!-- TODO: Galley: During single generator is off, if GALY AND CAB pb is off (TODO: Do we have this?) is off -->
<channel name="Overhead Lights" execrate="8">

161
Systems/a320-fmgc.xml Normal file
View file

@ -0,0 +1,161 @@
<!-- Airbus A320 FMGC -->
<!-- Copyright (c) 2019 Jonathan Redpath -->
<system name="A320: FMGC">
<channel name="FMGC" execrate="8">
<fcs_function name="/systems/fmgc/cas-compare/cas-1-to-3">
<function>
<abs>
<difference>
<property>/systems/navigation/adr/output/cas-1</property>
<property>/systems/navigation/adr/output/cas-3</property>
</difference>
</abs>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/cas-compare/cas-2-to-3">
<function>
<abs>
<difference>
<property>/systems/navigation/adr/output/cas-2</property>
<property>/systems/navigation/adr/output/cas-3</property>
</difference>
</abs>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/cas-compare/cas-2-to-1">
<function>
<abs>
<difference>
<property>/systems/navigation/adr/output/cas-2</property>
<property>/systems/navigation/adr/output/cas-1</property>
</difference>
</abs>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/cas-compare/cas-reject-all">
<function>
<ifthen>
<and>
<gt>
<property>/systems/fmgc/cas-compare/cas-1-to-3</property>
<value>5</value> <!-- todo - find proper value -->
</gt>
<gt>
<property>/systems/fmgc/cas-compare/cas-2-to-1</property>
<value>5</value>
</gt>
<gt>
<property>/systems/fmgc/cas-compare/cas-2-to-3</property>
<value>5</value>
</gt>
</and>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/cas-compare/cas-reject-1"> <!-- 2 and 3 are the same but 1 is different -->
<function>
<ifthen>
<and>
<gt>
<property>/systems/fmgc/cas-compare/cas-1-to-3</property>
<value>5</value> <!-- todo - find proper value -->
</gt>
<gt>
<property>/systems/fmgc/cas-compare/cas-2-to-1</property>
<value>5</value>
</gt>
<lt>
<property>/systems/fmgc/cas-compare/cas-2-to-3</property>
<value>5</value>
</lt>
</and>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/cas-compare/cas-reject-2"> <!-- 1 and 3 are the same but 2 is different -->
<function>
<ifthen>
<and>
<gt>
<property>/systems/fmgc/cas-compare/cas-2-to-3</property>
<value>5</value> <!-- todo - find proper value -->
</gt>
<gt>
<property>/systems/fmgc/cas-compare/cas-2-to-1</property>
<value>5</value>
</gt>
<lt>
<property>/systems/fmgc/cas-compare/cas-1-to-3</property>
<value>5</value>
</lt>
</and>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/cas-compare/cas-reject-3"> <!-- 1 and 2 are the same but 3 is different -->
<function>
<ifthen>
<and>
<gt>
<property>/systems/fmgc/cas-compare/cas-1-to-3</property>
<value>5</value> <!-- todo - find proper value -->
</gt>
<gt>
<property>/systems/fmgc/cas-compare/cas-2-to-3</property>
<value>5</value>
</gt>
<lt>
<property>/systems/fmgc/cas-compare/cas-2-to-1</property>
<value>5</value>
</lt>
</and>
<value>1</value>
<value>0</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/active-airspeed-src-1">
<function>
<ifthen>
<eq>
<property>/systems/fmgc/cas-compare/cas-reject-1</property>
<value>1</value>
</eq>
<value>3</value>
<value>1</value>
</ifthen>
</function>
</fcs_function>
<fcs_function name="/systems/fmgc/active-airspeed-src-2">
<function>
<ifthen>
<eq>
<property>/systems/fmgc/cas-compare/cas-reject-2</property>
<value>1</value>
</eq>
<value>3</value>
<value>2</value>
</ifthen>
</function>
</fcs_function>
</channel>
</system>

View file

@ -216,7 +216,7 @@
</and>
</condition>
</enable>
<input>/instrumentation/airspeed-indicator/indicated-speed-kt</input>
<input>/it-autoflight/internal/current-speed-input</input>
<reference>/it-autoflight/internal/kts</reference>
<output>/controls/engines/throttle-cmd-pid</output>
<config>
@ -340,7 +340,7 @@
</condition>
</enable>
<input>
<property>/instrumentation/airspeed-indicator/indicated-mach</property>
<property>/it-autoflight/internal/current-mach-input</property>
<scale>1000.0</scale>
</input>
<reference>

View file

@ -9,30 +9,91 @@
<adf>
<name>adf</name>
<number>0</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</adf>
<adf>
<name>adf</name>
<number>1</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</adf>
<airspeed-indicator>
<name>airspeed-indicator</name>
<name>airspeed-indicator</name> <!-- standby, measure directly, not via ADR -->
<number>0</number>
<total-pressure>/systems/pitot/total-pressure-inhg</total-pressure>
<static-pressure>/systems/static/pressure-inhg</static-pressure>
<total-pressure>/systems/pitot[2]/measured-total-pressure-inhg</total-pressure>
<static-pressure>/systems/static[2]/pressure-inhg</static-pressure>
</airspeed-indicator>
<altimeter>
<name>altimeter</name>
<number>0</number>
<static-pressure>/systems/static/pressure-inhg</static-pressure>
<quantum>0</quantum>
<tau>0</tau>
<static-pressure>/systems/static[0]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>1</number>
<static-pressure>/systems/static[1]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>2</number>
<static-pressure>/systems/static[2]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>3</number>
<static-pressure>/systems/static[0]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>4</number>
<static-pressure>/systems/static[1]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name>
<number>5</number>
<static-pressure>/systems/static[2]/pressure-inhg</static-pressure>
<quantum>1</quantum>
<tau>0.1</tau>
<encode-mode-c>1</encode-mode-c>
<encode-mode-s>1</encode-mode-s>
</altimeter>
<altimeter>
<name>altimeter</name> <!-- standby, measure directly, not via ADR -->
<number>6</number>
<static-pressure>/systems/static[2]/pressure-inhg</static-pressure>
<tau>0.1</tau>
</altimeter>
<attitude-indicator>
<name>attitude-indicator</name>
<number>0</number>
@ -65,21 +126,29 @@
<dme>
<name>dme</name>
<number>0</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</dme>
<dme>
<name>dme</name>
<number>1</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</dme>
<dme>
<dme> <!-- fake extra dme units for the ILS -->
<name>dme</name>
<number>2</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</dme>
<dme>
<name>dme</name>
<number>3</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</dme>
<altimeter>
@ -111,24 +180,39 @@
<number>0</number>
</magnetic-compass>
<nav-radio>
<marker-beacon> <!-- part of VOR1 unit -->
<name>marker-beacon</name>
<number>0</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</marker-beacon>
<nav-radio> <!-- VOR unit -->
<name>nav</name>
<number>0</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio>
<nav-radio>
<name>nav</name>
<number>1</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio>
<nav-radio>
<nav-radio> <!-- ILS unit -->
<name>nav</name>
<number>2</number>
<power-supply>/systems/electrical/bus/ac-ess-shed</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio>
<nav-radio>
<name>nav</name>
<number>3</number>
<power-supply>/systems/electrical/bus/ac-2</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</nav-radio>
<slip-skid-ball>
@ -140,6 +224,8 @@
<name>transponder</name>
<number>0</number>
<mode>2</mode>
<encoder-path>/instrumentation/transponder/altimeter-input</encoder-path>
<airspeed-path>/instrumentation/transponder/airspeed-input</airspeed-path>
<mode-c-altitude>/instrumentation/encoder/mode-c-alt-ft</mode-c-altitude>
<mode-s-altitude>/instrumentation/encoder/mode-s-alt-ft</mode-s-altitude>
</transponder>
@ -175,6 +261,22 @@
<number>0</number>
</radar>
<radar-altimeter>
<name>radar-altimeter</name>
<number>0</number>
<update-interval-sec>0.0666</update-interval-sec>
<power-supply>/systems/electrical/bus/ac-1</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</radar-altimeter>
<radar-altimeter>
<name>radar-altimeter</name>
<number>1</number>
<update-interval-sec>0.0666</update-interval-sec>
<power-supply>/systems/electrical/bus/ac-2</power-supply>
<minimum-supply-volts>109.9</minimum-supply-volts>
</radar-altimeter>
<tacan>
<name>tacan</name>
<number>0</number>

View file

@ -121,13 +121,121 @@
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter/indicated-altitude-ft</property></abs>
<abs><property>/instrumentation/altimeter[0]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter/indicated-altitude-ft-pfd</output>
<output>/instrumentation/altimeter[0]/indicated-altitude-ft-pfd</output>
</filter>
<filter>
<name>Altitude PFD</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<input>
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter[1]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter[1]/indicated-altitude-ft-pfd</output>
</filter>
<filter>
<name>Altitude PFD</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<input>
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter[2]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter[2]/indicated-altitude-ft-pfd</output>
</filter>
<filter>
<name>Altitude PFD</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<input>
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter[3]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter[3]/indicated-altitude-ft-pfd</output>
</filter>
<filter>
<name>Altitude PFD</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<input>
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter[4]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter[4]/indicated-altitude-ft-pfd</output>
</filter>
<filter>
<name>Altitude PFD</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<input>
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter[5]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter[5]/indicated-altitude-ft-pfd</output>
</filter>
<filter>
<name>Altitude PFD</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<input>
<expression>
<floor>
<div>
<abs><property>/instrumentation/altimeter[6]/indicated-altitude-ft</property></abs>
<value>100</value>
</div>
</floor>
</expression>
</input>
<output>/instrumentation/altimeter[6]/indicated-altitude-ft-pfd</output>
</filter>
<filter>

View file

@ -174,12 +174,46 @@
<input>
<expression>
<difference>
<property>/instrumentation/airspeed-indicator/indicated-speed-kt</property>
<property>/systems/navigation/adr/output/cas-1</property>
<value>30</value>
</difference>
</expression>
</input>
<output>/instrumentation/pfd/speed-minus-30</output>
<output>/instrumentation/pfd/speed-minus-30-1</output>
<min>0</min>
<max>390</max>
</filter>
<filter>
<name>Speed Predictor Input</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<difference>
<property>/systems/navigation/adr/output/cas-2</property>
<value>30</value>
</difference>
</expression>
</input>
<output>/instrumentation/pfd/speed-minus-30-2</output>
<min>0</min>
<max>390</max>
</filter>
<filter>
<name>Speed Predictor Input</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<difference>
<property>/systems/navigation/adr/output/cas-3</property>
<value>30</value>
</difference>
</expression>
</input>
<output>/instrumentation/pfd/speed-minus-30-3</output>
<min>0</min>
<max>390</max>
</filter>
@ -193,12 +227,57 @@
<filter-gain>0.01</filter-gain>
</predict-simple>
<predict-simple>
<name>Speed Predictor (Smoothed)</name>
<debug>false</debug>
<input>/instrumentation/pfd/speed-minus-30-1</input>
<output>/instrumentation/pfd/speed-lookahead-cmd-1</output>
<seconds>10.0</seconds>
<filter-gain>0.01</filter-gain>
</predict-simple>
<predict-simple>
<name>Speed Predictor (Smoothed)</name>
<debug>false</debug>
<input>/instrumentation/pfd/speed-minus-30-2</input>
<output>/instrumentation/pfd/speed-lookahead-cmd-2</output>
<seconds>10.0</seconds>
<filter-gain>0.01</filter-gain>
</predict-simple>
<predict-simple>
<name>Speed Predictor (Smoothed)</name>
<debug>false</debug>
<input>/instrumentation/pfd/speed-minus-30-3</input>
<output>/instrumentation/pfd/speed-lookahead-cmd-3</output>
<seconds>10.0</seconds>
<filter-gain>0.01</filter-gain>
</predict-simple>
<filter>
<name>Speed Predictor Exponential</name>
<debug>false</debug>
<type>exponential</type>
<input>/instrumentation/pfd/speed-lookahead-cmd</input>
<output>/instrumentation/pfd/speed-lookahead</output>
<input>/instrumentation/pfd/speed-lookahead-cmd-1</input>
<output>/instrumentation/pfd/speed-lookahead-1</output>
<filter-time>0.32</filter-time>
</filter>
<filter>
<name>Speed Predictor Exponential</name>
<debug>false</debug>
<type>exponential</type>
<input>/instrumentation/pfd/speed-lookahead-cmd-2</input>
<output>/instrumentation/pfd/speed-lookahead-2</output>
<filter-time>0.32</filter-time>
</filter>
<filter>
<name>Speed Predictor Exponential</name>
<debug>false</debug>
<type>exponential</type>
<input>/instrumentation/pfd/speed-lookahead-cmd-3</input>
<output>/instrumentation/pfd/speed-lookahead-3</output>
<filter-time>0.32</filter-time>
</filter>

57
Systems/pitot-static.xml Normal file
View file

@ -0,0 +1,57 @@
<?xml version="1.0"?>
<PropertyList>
<pitot>
<name>pitot</name>
<number>0</number>
</pitot>
<pitot>
<name>pitot</name>
<number>1</number>
</pitot>
<pitot>
<name>pitot</name>
<number>2</number>
</pitot>
<static>
<name>static</name>
<number>0</number>
<tau>0.7</tau>
<type>1</type>
<error-factor>0.43</error-factor>
</static>
<static>
<name>static</name>
<number>1</number>
<tau>0.7</tau>
<type>1</type>
<error-factor>0.42</error-factor>
</static>
<static>
<name>static</name>
<number>2</number>
<tau>0.7</tau>
<type>1</type>
<error-factor>0.45</error-factor>
</static>
<vacuum> <!-- todo get property based on elec -->
<name>vacuum</name>
<number>0</number>
<rpm>/engines/engine[0]/rpm</rpm>
<scale>1.0</scale>
</vacuum>
<vacuum>
<name>vacuum</name>
<number>1</number>
<rpm>/engines/engine[1]/rpm</rpm>
<scale>1.0</scale>
</vacuum>
</PropertyList>