1
0
Fork 0

Merge branch 'dev' into new-electrical

This commit is contained in:
legoboyvdlp R 2021-03-11 12:12:23 +00:00
commit 3f9852d0f0
97 changed files with 6444 additions and 1192 deletions

View file

@ -206,9 +206,9 @@
<autopilot n="0">
<path>Aircraft/A320-family/Systems/fadec-cfm.xml</path>
</autopilot>
<autopilot n="10">
<property-rule n="100">
<path>Aircraft/A320-family/Systems/cfm56-sound.xml</path>
</autopilot>
</property-rule>
</systems>
</sim>

View file

@ -206,9 +206,9 @@
<autopilot n="0">
<path>Aircraft/A320-family/Systems/fadec-cfm.xml</path>
</autopilot>
<autopilot n="10">
<property-rule n="100">
<path>Aircraft/A320-family/Systems/cfm56-sound.xml</path>
</autopilot>
</property-rule>
</systems>
</sim>

View file

@ -206,9 +206,9 @@
<autopilot n="0">
<path>Aircraft/A320-family/Systems/fadec-iae.xml</path>
</autopilot>
<autopilot n="10">
<property-rule n="100">
<path>Aircraft/A320-family/Systems/v2500-sound.xml</path>
</autopilot>
</property-rule>
</systems>
</sim>

View file

@ -234,15 +234,15 @@
<path>Aircraft/A320-family/Systems/pfd.xml</path>
</autopilot>
<!-- 10 is sound -->
<autopilot n="11">
<property-rule n="101">
<path>Aircraft/A320-family/Systems/sound-common.xml</path>
</autopilot>
<autopilot n="12">
</property-rule>
<property-rule n="110">
<path>Aircraft/A320-family/Systems/a320-lights-proprules.xml</path>
</autopilot>
<autopilot n="13">
</property-rule>
<property-rule n="111">
<path>Aircraft/A320-family/Systems/ecam-proprules.xml</path>
</autopilot>
</property-rule>
<path>Aircraft/A320-family/Systems/pitot-static.xml</path>
</systems>
@ -652,6 +652,14 @@
<line8 type="string"></line8>
</rightmsg>
<warning-phase type="int">0</warning-phase>
<phases>
<timer>
<ldg-inhibit type="int">0</ldg-inhibit>
<ldg-inhibit-output type="double">0</ldg-inhibit-output>
<to-inhibit type="int">0</to-inhibit>
<to-inhibit-output type="double">0</to-inhibit-output>
</timer>
</phases>
</ECAM>
<environment>
@ -776,6 +784,8 @@
<atc>
<system-knob type="int">0</system-knob>
<mode-knob type="int">0</mode-knob>
<abv-blw type="int">0</abv-blw>
<thrt-all type="int">0</thrt-all>
</atc>
<apu>
<agent-btn type="bool">0</agent-btn>
@ -920,7 +930,7 @@
</fuel>
<gear>
<brake-fans type="bool">0</brake-fans>
<brake-parking type="bool">0</brake-parking>
<brake-parking type="bool">1</brake-parking>
<tiller-cmd-norm type="double">0</tiller-cmd-norm>
<tiller-enabled type="bool">0</tiller-enabled>
<nws-switch type="double">1</nws-switch>
@ -1348,11 +1358,14 @@
<spoiler-r4 type="bool">0</spoiler-r4>
<spoiler-r5 type="bool">0</spoiler-r5>
</spoilers>
<fire>
<engine-left-fire type="bool">0</engine-left-fire>
<engine-right-fire type="bool">0</engine-right-fire>
<apu-fire type="bool">0</apu-fire>
<cargo-fwd-fire type="bool">0</cargo-fwd-fire>
<cargo-aft-fire type="bool">0</cargo-aft-fire>
<lavatory-fire type="bool">0</lavatory-fire>
</fire>
</failures>
<fctl n="0">
@ -1385,6 +1398,9 @@
<temperature type="double">0</temperature>
</fwd>
</cargo>
<lavatory>
<temperature type="double">0</temperature>
</lavatory>
</fire>
<fuel n="0">
<only-use-ctr-tank type="bool">0</only-use-ctr-tank>
@ -1637,7 +1653,7 @@
<comm n="2">
<frequencies>
<selected-mhz type="double">0</selected-mhz>
<selected-mhz type="double">121.5</selected-mhz>
<standby-mhz type="double">123.2</standby-mhz>
</frequencies>
<serviceable type="bool">true</serviceable>
@ -1825,8 +1841,9 @@
<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>
<max-range-m type="int">1525</max-range-m>
<serviceable type="bool">true</serviceable>
<radar-altitude-ft type="double">0</radar-altitude-ft>
</radar-altimeter>
<radar-altimeter n="1">
@ -1839,8 +1856,9 @@
<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>
<max-range-m type="int">1525</max-range-m>
<serviceable type="bool">true</serviceable>
<radar-altitude-ft type="double">0</radar-altitude-ft>
</radar-altimeter>
<wxr>
@ -4677,10 +4695,7 @@
<file>Aircraft/A320-family/Nasal/MCDU/ROUTESELECTION.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/INITB.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/FUELPRED.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PROGTO.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PROGCLB.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PROGCRZ.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PROGDES.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PROG.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PERFAPPR.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PERFCLB.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PERFCRZ.nas</file>
@ -4692,6 +4707,11 @@
<file>Aircraft/A320-family/Nasal/MCDU/DATA2.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/STATUS.nas</file>
</mcdu>
<!-- Traffic layer from E-jet -->
<traffic>
<file>Aircraft/A320-family/Nasal/Displays/projection.nas</file>
<file>Aircraft/A320-family/Nasal/Displays/traffic.nas</file>
</traffic>
<!-- Canvas -->
<canvas_pfd>
<file>Aircraft/A320-family/Models/Instruments/PFD/PFD.nas</file>

View file

@ -206,9 +206,9 @@
<autopilot n="0">
<path>Aircraft/A320-family/Systems/fadec-cfm.xml</path>
</autopilot>
<autopilot n="10">
<property-rule n="100">
<path>Aircraft/A320-family/Systems/leapx-sound.xml</path>
</autopilot>
</property-rule>
</systems>
</sim>

View file

@ -206,9 +206,9 @@
<autopilot n="0"> <!-- Apparently PW PurePower uses N1, not EPR.... sooo I use CFM FADEC -->
<path>Aircraft/A320-family/Systems/fadec-cfm.xml</path>
</autopilot>
<autopilot n="10">
<property-rule n="100">
<path>Aircraft/A320-family/Systems/leapx-sound.xml</path>
</autopilot>
</property-rule>
</systems>
</sim>

View file

@ -56,10 +56,12 @@ var failResetOld = func {
setprop("/systems/failures/pump-green", 0);
setprop("/systems/failures/pump-yellow-eng", 0);
setprop("/systems/failures/pump-yellow-elec", 0);
setprop("/systems/failures/cargo-aft-fire", 0);
setprop("/systems/failures/cargo-fwd-fire", 0);
setprop("/systems/failures/engine-left-fire", 0);
setprop("/systems/failures/engine-right-fire", 0);
setprop("/systems/failures/fire/cargo-aft-fire", 0);
setprop("/systems/failures/fire/cargo-fwd-fire", 0);
setprop("/systems/failures/fire/engine-left-fire", 0);
setprop("/systems/failures/fire/apu-fire", 0);
setprop("/systems/failures/fire/engine-right-fire", 0);
setprop("/systems/failures/fire/lavatory-fire", 0);
}
failResetOld();
@ -296,6 +298,7 @@ var colddark = func {
setprop("/controls/lighting/overhead-panel-knb", 0);
atc.transponderPanel.modeSwitch(1);
libraries.systemsInit();
libraries.variousReset();
failResetOld();
if (getprop("/engines/engine[1]/n2-actual") < 2) {
colddark_b();
@ -341,6 +344,7 @@ var beforestart = func {
setprop("/controls/gear/gear-down", 1);
setprop("/controls/flight/elevator-trim", 0);
libraries.systemsInit();
libraries.variousReset();
failResetOld();
# Now the Startup!
@ -398,6 +402,9 @@ var beforestart_b = func {
setprop("/controls/adirs/mcducbtn", 1);
setprop("/controls/switches/beacon", 1);
setprop("/controls/lighting/nav-lights-switch", 1);
setprop("/controls/switches/no-smoking-sign", 0.5);
setprop("/controls/switches/seatbelt-sign", 1);
setprop("/controls/switches/emer-lights", 0.5);
setprop("/controls/radio/rmp[0]/on", 1);
setprop("/controls/radio/rmp[1]/on", 1);
setprop("/controls/radio/rmp[2]/on", 1);
@ -432,6 +439,7 @@ var taxi = func {
setprop("/controls/gear/gear-down", 1);
setprop("/controls/flight/elevator-trim", 0);
libraries.systemsInit();
libraries.variousReset();
failResetOld();
# Now the Startup!
@ -490,6 +498,9 @@ var taxi_b = func {
setprop("/controls/switches/beacon", 1);
setprop("/controls/switches/wing-lights", 1);
setprop("/controls/lighting/nav-lights-switch", 1);
setprop("/controls/switches/no-smoking-sign", 0.5);
setprop("/controls/switches/seatbelt-sign", 1);
setprop("/controls/switches/emer-lights", 0.5);
setprop("/controls/radio/rmp[0]/on", 1);
setprop("/controls/radio/rmp[1]/on", 1);
setprop("/controls/radio/rmp[2]/on", 1);

View file

@ -560,7 +560,7 @@
<stretch type="bool">true</stretch>
</hrule>
<text>
<label>Cargo Fire</label>
<label>Fire</label>
</text>
<hrule>
<stretch type="bool">true</stretch>
@ -568,9 +568,9 @@
</group>
<checkbox>
<label>AFT</label>
<label>AFT CRG</label>
<halign>left</halign>
<property>/systems/failures/cargo-aft-fire</property>
<property>/systems/failures/fire/cargo-aft-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -578,14 +578,25 @@
</checkbox>
<checkbox>
<label>FWD</label>
<label>FWD CRG</label>
<halign>left</halign>
<property>/systems/failures/cargo-fwd-fire</property>
<property>/systems/failures/fire/cargo-fwd-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<label>LAV</label>
<halign>left</halign>
<property>/systems/failures/fire/lavatory-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
<live>true</live>
</checkbox>
<group>
<layout>hbox</layout>
@ -603,7 +614,7 @@
<checkbox>
<label>Left Engine</label>
<halign>left</halign>
<property>/systems/failures/engine-left-fire</property>
<property>/systems/failures/fire/engine-left-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -613,7 +624,7 @@
<checkbox>
<label>APU</label>
<halign>left</halign>
<property>/systems/failures/apu-fire</property>
<property>/systems/failures/fire/apu-fire</property>
<binding>
<command>dialog-apply</command>
</binding>
@ -623,7 +634,7 @@
<checkbox>
<label>Right Engine</label>
<halign>left</halign>
<property>/systems/failures/engine-right-fire</property>
<property>/systems/failures/fire/engine-right-fire</property>
<binding>
<command>dialog-apply</command>
</binding>

View file

@ -8,7 +8,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>systems/failures/engine-left-fire</on-fire>
<on-fire>systems/failures/fire/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
</params>

View file

@ -8,7 +8,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>systems/failures/engine-right-fire</on-fire>
<on-fire>systems/failures/fire/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
</params>

View file

@ -13,7 +13,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>systems/failures/engine-left-fire</on-fire>
<on-fire>systems/failures/fire/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
</params>

View file

@ -13,7 +13,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>systems/failures/engine-right-fire</on-fire>
<on-fire>systems/failures/fire/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
</params>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>systems/failures/engine-left-fire</on-fire>
<on-fire>systems/failures/fire/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
<pylon-model-path>Aircraft/A320-family/Models/Engines/XMLs/a320.pylon.cfm.left.xml</pylon-model-path>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>systems/failures/engine-right-fire</on-fire>
<on-fire>systems/failures/fire/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
<pylon-model-path>Aircraft/A320-family/Models/Engines/XMLs/a320.pylon.cfm.right.xml</pylon-model-path>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[3]/n1</n1>
<on-fire>systems/failures/engine-left-fire</on-fire>
<on-fire>systems/failures/fire/engine-left-fire</on-fire>
<contrail>engines/engine[0]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[2]</reverser-pos-norm>
<pylon-model-path>Aircraft/A320-family/Models/Engines/XMLs/a320.pylon.iae.left.xml</pylon-model-path>

View file

@ -10,7 +10,7 @@
<params>
<n1>engines/engine[4]/n1</n1>
<on-fire>systems/failures/engine-right-fire</on-fire>
<on-fire>systems/failures/fire/engine-right-fire</on-fire>
<contrail>engines/engine[1]/contrail</contrail>
<reverser-pos-norm>sim/multiplay/generic/float[3]</reverser-pos-norm>
<pylon-model-path>Aircraft/A320-family/Models/Engines/XMLs/a320.pylon.iae.right.xml</pylon-model-path>

View file

@ -893,6 +893,80 @@
</condition>
</animation>
<animation>
<type>rotate</type>
<object-name>atc_abv</object-name>
<factor>35</factor>
<offset-deg>0</offset-deg>
<axis>
<object-name>atc_abv.axis</object-name>
</axis>
<property>controls/atc/abv-blw</property>
</animation>
<animation>
<type>pick</type>
<object-name>atc_abv</object-name>
<action>
<button>0</button>
<button>3</button>
<binding>
<command>property-cycle</command>
<property>controls/atc/abv-blw</property>
<value>-1</value>
<value>0</value>
<value>1</value>
</binding>
</action>
<action>
<button>1</button>
<button>4</button>
<binding>
<command>property-cycle</command>
<property>controls/atc/abv-blw</property>
<value>1</value>
<value>0</value>
<value>-1</value>
</binding>
</action>
</animation>
<animation>
<type>rotate</type>
<object-name>atc_thrt</object-name>
<factor>-30</factor>
<offset-deg>0</offset-deg>
<axis>
<object-name>atc_thrt.axis</object-name>
</axis>
<property>controls/atc/thrt-all</property>
</animation>
<animation>
<type>pick</type>
<object-name>atc_thrt</object-name>
<action>
<button>0</button>
<button>3</button>
<binding>
<command>property-cycle</command>
<property>controls/atc/thrt-all</property>
<value>0</value>
<value>1</value>
</binding>
</action>
<action>
<button>1</button>
<button>4</button>
<binding>
<command>property-cycle</command>
<property>controls/atc/thrt-all</property>
<value>0</value>
<value>1</value>
</binding>
</action>
</animation>
<!-- Primary Flight Displays -->
<model>
<name>PFD1</name>
@ -1367,14 +1441,32 @@
<button>0</button>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</and>
</condition>
<command>property-toggle</command>
<property>controls/switches/terr_on_nd_l</property>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-toggle</command>
<property>instrumentation/efis/inputs/terr</property>
</binding>
</action>
</animation>
@ -1408,14 +1500,32 @@
<button>0</button>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
</and>
</condition>
<command>property-toggle</command>
<property>controls/switches/terr_on_nd_r</property>
</binding>
<binding>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/dc-ess</property>
<value>25</value>
</greater-than-equals>
<equals>
<property>instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit</property>
<value>0</value>
</equals>
</and>
</condition>
<command>property-toggle</command>
<property>instrumentation/efis[1]/inputs/terr</property>
</binding>
</action>
</animation>
@ -8668,6 +8778,40 @@
</condition>
</animation>
<!-- ND_L chrono -->
<animation>
<type>pick</type>
<object-name>chrono_cpt</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>/instrumentation/efis/inputs/CHRONO</property>
<value>0</value>
<value>1</value>
<value>2</value>
</binding>
</action>
</animation>
<!-- ND_R chrono -->
<animation>
<type>pick</type>
<object-name>chrono_fo</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>property-cycle</command>
<property>/instrumentation/efis[1]/inputs/CHRONO</property>
<value>0</value>
<value>1</value>
<value>2</value>
</binding>
</action>
</animation>
<!-- torch -->
<animation>

View file

@ -32,7 +32,7 @@
<z-m>0.95</z-m>
</offsets>
<condition>
<property>systems/failures/apu-fire</property>
<property>systems/failures/fire/apu-fire</property>
</condition>
</model>

View file

@ -32,7 +32,7 @@
<z-m>0.95</z-m>
</offsets>
<condition>
<property>systems/failures/apu-fire</property>
<property>systems/failures/fire/apu-fire</property>
</condition>
</model>

View file

@ -32,7 +32,7 @@
<z-m>0.95</z-m>
</offsets>
<condition>
<property>systems/failures/apu-fire</property>
<property>systems/failures/fire/apu-fire</property>
</condition>
</model>

View file

@ -270,8 +270,6 @@ var input = {
"altitude_ind": "/instrumentation/altimeter/indicated-altitude-ft-pfd",
"altimeter_mode": "/instrumentation/altimeter[0]/std",
"attReset": "/instrumentation/iesi/att-reset",
"dcEss": "/systems/electrical/bus/dc-ess",
"dcHot1": "/systems/electrical/bus/dc-hot-1",
"iesiBrt": "/controls/lighting/DU/iesi",
"iesiInit": "/instrumentation/iesi/iesi-init",
"mach": "/instrumentation/airspeed-indicator/indicated-mach",

View file

@ -3010,7 +3010,7 @@ var canvas_lowerECAM_wheel = {
rightdoor = gear_door_R.getValue();
nosedoor = gear_door_N.getValue();
gearlvr = gear_down.getValue();
askidsw = systems.HYD.Brakes.askidSw.getBoolValue();
askidsw = systems.HYD.Switch.nwsSwitch.getBoolValue();
brakemode = systems.HYD.Brakes.mode.getBoolValue();
accum = systems.HYD.Brakes.accumPressPsi.getBoolValue();

View file

@ -151,7 +151,6 @@ var baro = props.globals.getNode("/FMGC/internal/baro", 1);
# GA PERF
# AOC - SENSORS
var parking_brake = props.globals.getNode("/controls/gear/brake-parking", 1);
var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1);
var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); #FWD door
var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); #FWD door
@ -165,6 +164,7 @@ var activeAtsu = [props.globals.getNode("/MCDU[0]/atsu-active", 1), props.global
props.globals.initNode("/MCDU[0]/active-system", "", "STRING");
props.globals.initNode("/MCDU[1]/active-system", "", "STRING");
# Conversion factor pounds to kilogram
var LBS2KGS = 0.4535924;
@ -172,6 +172,17 @@ var LBS2KGS = 0.4535924;
# Create Nodes:
var pageSwitch = [props.globals.initNode("/MCDU[0]/internal/switch", 0, "BOOL"), props.globals.initNode("/MCDU[1]/internal/switch", 0, "BOOL")];
# Page freeze on POSMON
var pageFreezed = [nil,nil];
var togglePageFreeze = func(i) {
if (pageFreezed[i] == nil) {
pageFreezed[i] = sprintf("%02d%02d", getprop("/sim/time/utc/hour"), getprop("/sim/time/utc/minute"));
} else {
pageFreezed[i] = nil;
}
}
var canvas_MCDU_base = {
init: func(canvas_group, file) {
var font_mapper = func(family, weight) {
@ -228,6 +239,8 @@ var canvas_MCDU_base = {
me.page = canvas_group;
me.updateretard = 0; # skip a few page update to save CPU
return me;
},
getKeys: func() {
@ -348,6 +361,10 @@ var canvas_MCDU_base = {
me.fontSizeLeftS(small, small, small, small, small, small);
me.fontSizeRight(normal, normal, normal, normal, normal, normal);
me.fontSizeRightS(small, small, small, small, small, small);
me.fontCenter(default, default, default, default, default, default);
me.fontCenterS(default, default, default, default, default, default);
me.fontSizeCenter(normal, normal, normal, normal, normal, normal);
me.fontSizeCenterS(small, small, small, small, small, small);
},
standardFontColour: func() {
me.colorLeft("wht", "wht", "wht", "wht", "wht", "wht");
@ -357,6 +374,43 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
},
getLatLogFormatted: func(rootpropname) {
var dms = getprop(rootpropname ~ "latitude-deg");
var degrees = int(dms);
var minutes = sprintf("%.1f",abs((dms - degrees) * 60));
var sign = degrees >= 0 ? "N" : "S";
var dms2 = getprop(rootpropname ~ "longitude-deg");
var degrees2 = int(dms2);
var minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60));
var sign2 = degrees2 >= 0 ? "E" : "W";
return sprintf("%d%.1f%s/%07s%s",abs(degrees),minutes,sign,abs(degrees2) ~ minutes2,sign2);
},
getLatLogFormatted2: func(rootpropname) {
var dms = getprop(rootpropname ~ "latitude-deg");
var degrees = int(dms);
var minutes = sprintf("%.1f",abs((dms - degrees) * 60));
var sign = degrees >= 0 ? "N" : "S";
var dms2 = getprop(rootpropname ~ "longitude-deg");
var degrees2 = int(dms2);
var minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60));
var sign2 = degrees2 >= 0 ? "E" : "W";
return sprintf("%d %.1f%s/%03s %.1f%s",abs(degrees),minutes,sign,abs(degrees2),minutes2,sign2);
},
getIRSStatus: func(a,b = 0) {
var irsstatus = "INVAL";
if (systems.ADIRS.ADIRunits[a].operative) {
if (systems.ADIRS.Operating.aligned[a].getValue()) {
irsstatus = (systems.ADIRS.ADIRunits[a].mode == 2) ? "ATT" : "NAV";
} else {
if (b) {
irsstatus = "ALIGN TTN" ~ sprintf("%2d",math.round(systems.ADIRS.ADIRunits[a]._alignTime) / 60);
} else {
irsstatus = "ALIGN";
}
}
}
return irsstatus;
},
updateCommon: func(i) {
page = pageProp[i].getValue();
if (page != "NOTIFICATION") {
@ -789,8 +843,8 @@ var canvas_MCDU_base = {
pageSwitch[i].setBoolValue(1);
}
me["Simple_R1S"].setText(sprintf("%-10s",(parking_brake.getValue() == 1) ? "SET" : "RELEASED"));
me["Simple_R1"].setText(sprintf("%-10s",(gear0_wow.getValue() == 1) ? "GROUND" : "FLIGHT"));
me["Simple_R1S"].setText(sprintf("%-10s",(pts.Controls.Gear.parkingBrake.getValue() == 1) ? "SET" : "RELEASED"));
me["Simple_R1"].setText(sprintf("%-10s",(pts.Gear.wow[0].getValue() == 1) ? "GROUND" : "FLIGHT"));
me["Simple_R2S"].setText(sprintf("%-10s",(doorL1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
me["Simple_R2"].setText(sprintf("%-10s",(doorR1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
me["Simple_R3S"].setText(sprintf("%-10s",(doorL4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
@ -2253,12 +2307,12 @@ var canvas_MCDU_base = {
me["PERFAPPR"].hide();
me["PERFGA"].hide();
me["Simple_Title"].show();
me["Simple_Title"].setText("POSITION MONITOR");
me["Simple_Title2"].setColor(GREEN);
me.defaultPageNumbers();
me.showLeft(1, 1, 1, 1, 1, 1);
me["Simple_L0S"].hide();
me.showLeftS(-1, -1, -1, -1, 1, -1);
me.showLeftS(-1, 1, 1, -1, 1, -1);
me.showLeftArrow(-1, -1, -1, -1, -1, 1);
me.showCenter(-1, -1, -1, -1, 1, -1);
me["Simple_C3B"].hide();
@ -2276,26 +2330,228 @@ var canvas_MCDU_base = {
me.colorRight("grn", "grn", "grn", "grn", "grn", "wht");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
me["Simple_C5"].setColor(GREEN);
me["Simple_L5"].setFontSize(small);
me["Simple_C5"].setFontSize(small);
me["Simple_R5"].setFontSize(small);
pageFreezed[i] = nil;
me.updateretard = 0;
pageSwitch[i].setBoolValue(1);
}
if (me.updateretard <= 0) {
if (pageFreezed[i] == nil) {
me["Simple_Title"].setText("POSITION MONITOR");
me["Simple_Title2"].hide();
me["Simple_L6"].setText(" FREEZE");
me["Simple_L1"].setText("FMGC1");
me["Simple_L2"].setText("FMGC2");
me["Simple_L3"].setText("GPIRS");
me["Simple_L4"].setText("MIX IRS");
me["Simple_L5"].setText("NAV -.-");
me["Simple_L6"].setText(" FREEZE");
me["Simple_L5S"].setText(" IRS1");
me["Simple_R1"].setText("----.-X/-----.-X");
me["Simple_R2"].setText("----.-X/-----.-X");
me["Simple_R3"].setText("----.-X/-----.-X");
me["Simple_R4"].setText("----.-X/-----.-X");
me["Simple_R5"].setText("NAV -.-");
me["Simple_R5S"].setText("IRS3 ");
me["Simple_R6S"].setText("SEL ");
me["Simple_C5"].setText("NAV -.-");
me["Simple_R6"].setText("NAVAIDS ");
me["Simple_C5S"].setText("IRS2");
var latlog = me.getLatLogFormatted("/position/"); # current sim lat/log (formatted) cached for fast excecution
#TODO - IRS emulation
if (systems.ADIRS.Operating.aligned[0].getValue()) { # TODO real FMGC1 GPS data
me["Simple_R1"].setText(latlog);
me["Simple_R1"].setColor(GREEN);
me["Simple_L2S"].setText(sprintf("%16s","3IRS/GPS"));
} else {
me["Simple_R1"].setText("----.--/-----.--");
me["Simple_R1"].setColor(WHITE);
me["Simple_L2S"].setText("");
}
if (systems.ADIRS.Operating.aligned[1].getValue()) { # TODO real FMGC2 GPS data
me["Simple_R2"].setText(latlog);
me["Simple_R2"].setColor(GREEN);
me["Simple_L3S"].setText(sprintf("%16s","3IRS/GPS"));
} else {
me["Simple_R2"].setText("----.--/-----.--");
me["Simple_R2"].setColor(WHITE);
me["Simple_L3S"].setText("");
}
if (systems.ADIRS.Operating.aligned[0].getValue() or systems.ADIRS.Operating.aligned[1].getValue() or systems.ADIRS.Operating.aligned[2].getValue()) {
me["Simple_R3"].setText(latlog); # GPIRS
me["Simple_R3"].setColor(GREEN);
me["Simple_R4"].setText(latlog); # MIXIRS
me["Simple_R4"].setColor(GREEN);
} else {
me["Simple_R3"].setText("----.--/-----.--"); # GPIRS not available
me["Simple_R3"].setColor(WHITE);
me["Simple_R4"].setText("----.--/-----.--"); # MIXIRS not available
me["Simple_R4"].setColor(WHITE);
}
var Simple_row5 = ["Simple_L5","Simple_C5","Simple_R5"];
for ( var a=0; a<3; a+=1 ) {
if (systems.ADIRS.Operating.aligned[a].getValue()) {
me[Simple_row5[a]].setText(sprintf("%-8s",(systems.ADIRS.ADIRunits[a].mode == 2) ? "ATT" : "NAV 0.0"));
} else {
me[Simple_row5[a]].setText(sprintf("%-8s",me.getIRSStatus(a)));
}
}
} else {
me["Simple_Title"].setText("POSITION FROZEN AT ");
me["Simple_Title2"].setText(sprintf("%23s ",pageFreezed[i]));
me["Simple_Title2"].show();
me["Simple_L6"].setText(" UNFREEZE");
}
}
if (me.updateretard < 0) me.updateretard = 2;
else me.updateretard -= 1;
} else if (page == "IRSMON") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me.standardFontSize();
me.defaultPageNumbers();
me.showLeft(1, 1, 1, -1, -1, -1);
me.showLeftS(-1, 1, 1, 1, -1, -1);
me.showLeftArrow(1, 1, 1, -1, -1, -1);
me.showCenter(-1, -1, -1, -1, -1, -1);
me.showCenterS(-1, -1, -1, -1, -1, -1);
me.showRight(-1, -1, -1, -1, -1, -1);
me.showRightS(1, 1, 1, 1, -1, -1);
me.showRightArrow(-1, -1, -1, -1, -1, -1);
me["arrowsDepArr"].hide();
me["PERFAPPR"].hide();
me["PERFGA"].hide();
me["Simple_L0S"].hide();
me["Simple_Title"].show();
me.colorLeft("wht", "wht", "wht", "ack", "ack", "ack");
me.colorLeftS("ack", "grn", "grn", "grn", "ack", "ack");
me.colorCenter("wht", "grn", "grn", "grn", "ack", "ack");
me.colorRightS("amb", "grn", "grn", "grn", "ack", "ack");
me.colorLeftArrow("wht", "wht", "wht", "ack", "ack", "ack");
me["Simple_Title"].setText("IRS MONITOR");
me["Simple_L1"].setText(" IRS1");
me["Simple_L2"].setText(" IRS2");
me["Simple_L3"].setText(" IRS3");
me["Simple_C1"].setText("EXCESS MOTION");
me["Simple_C2"].setText("EXCESS MOTION");
me["Simple_C3"].setText("EXCESS MOTION");
me["Simple_C1"].setFontSize(small);
me["Simple_C2"].setFontSize(small);
me["Simple_C3"].setFontSize(small);
me["Simple_R1S"].setText("");
#TODO - Missing SET HDG on degraded operations
pageSwitch[i].setBoolValue(1);
}
var rows = ["Simple_L2S","Simple_L3S","Simple_L4S"];
var center = ["Simple_C1","Simple_C2","Simple_C3"];
for (var a = 0; a<3; a+=1) {
me[rows[a]].setText(" " ~ me.getIRSStatus(a,1));
if (systems.ADIRS.ADIRunits[a]._excessMotion) {
me[center[a]].show();
} else {
me[center[a]].hide();
}
}
if (fmgc.FMGCInternal.phase == 7) { # DONE phase
if (fmgc.FMGCInternal.arrApt != nil and fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
me["Simple_R1S"].setText(sprintf("DRIFT AT %7s ",fmgc.FMGCInternal.arrApt ~ fmgc.flightPlanController.flightplans[2].departure_runway.id));
}
me["Simple_R2S"].setText(sprintf("DRIFT %2.1fNM/H ",0));
me["Simple_R3S"].setText(sprintf("DRIFT %2.1fNM/H ",0));
me["Simple_R4S"].setText(sprintf("DRIFT %2.1fNM/H ",0));
} else {
me["Simple_R1S"].setText("");
me["Simple_R2S"].setText("");
me["Simple_R3S"].setText("");
me["Simple_R4S"].setText("");
}
} else if (page == "GPSMON") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me.standardFontSize();
me.defaultPageNumbers();
me.showLeft(1, 1, 1, 1, 1, 1);
me.showLeftS(1, 1, 1, 1, 1, 1);
me.showLeftArrow(-1, -1, -1, -1, -1, -1);
me.showCenter(-1, 1, 1, -1, 1, 1);
me.showCenterS(-1, 1, 1, -1, 1, 1);
me.showRight(-1, 1, 1, -1, 1, 1);
me.showRightS(-1, 1, 1, -1, 1, 1);
me.showRightArrow(-1, -1, -1, -1, -1, -1);
me["arrowsDepArr"].hide();
me["PERFAPPR"].hide();
me["PERFGA"].hide();
me["Simple_L0S"].hide();
me["Simple_Title"].show();
me.colorLeft("grn", "grn", "grn", "grn", "grn", "grn");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("grn", "grn", "grn", "grn", "grn", "grn");
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRight("grn", "grn", "grn", "grn", "grn", "grn");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me["Simple_Title"].setText("GPS MONITOR");
me["Simple_L1S"].setText("GPS1 POSITION");
me["Simple_L2S"].setText("TTRK");
me["Simple_L3S"].setText("MERIT");
me["Simple_L3"].setText(sprintf("%3d",((rand() * 50) - 25) + 50) ~ "M");
me["Simple_L4S"].setText("GPS2 POSITION");
me["Simple_L5S"].setText("TTRK");
me["Simple_L6S"].setText("MERIT");
me["Simple_L6"].setText(sprintf("%3d",((rand() * 50) - 25) + 50) ~ "M");
me["Simple_C2S"].setText("UTC");
me["Simple_C3S"].setText("GPS ALT");
me["Simple_C5S"].setText("UTC");
me["Simple_C6S"].setText("GPS ALT");
me["Simple_R2S"].setText("GS");
me["Simple_R3S"].setText("MODE/SAT");
me["Simple_R3"].setText("NAV/" ~ sprintf("%s",int((rand() * 2) - 1) + 6) ~ " ");
me["Simple_R5S"].setText("GS");
me["Simple_R6S"].setText("MODE/SAT");
me["Simple_R6"].setText("NAV/" ~ sprintf("%s",int((rand() * 2) - 1) + 6) ~ " ");
pageSwitch[i].setBoolValue(1);
}
me["Simple_L1"].setText(me.getLatLogFormatted2("/position/"));
me["Simple_L2"].setText(sprintf("%-5.1f",pts.Instrumentation.GPS.trackMag.getValue() + magvar()));
me["Simple_L4"].setText(me.getLatLogFormatted2("/position/"));
me["Simple_L5"].setText(sprintf("%-5.1f",pts.Instrumentation.GPS.trackMag.getValue() + magvar()));
var gmt = string.replace(pts.Sim.Time.gmtString.getValue(),":",".");
me["Simple_C2"].setText(gmt);
me["Simple_C5"].setText(gmt);
me["Simple_C3"].setText(sprintf("%5.0f",pts.Instrumentation.GPS.altitude.getValue()));
me["Simple_C6"].setText(sprintf("%5.0f",pts.Instrumentation.GPS.altitude.getValue()));
me["Simple_R2"].setText(sprintf("%3.0f",pts.Instrumentation.GPS.gs.getValue()));
me["Simple_R5"].setText(sprintf("%3.0f",pts.Instrumentation.GPS.gs.getValue()));
} else if (page == "RADNAV") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
@ -3576,7 +3832,8 @@ var canvas_MCDU_base = {
me["Simple_L6"].setFontSize(small);
}
} else if (page == "PROGPREF" or page == "PROGTO" or page == "PROGCLB" or page == "PROGCRZ" or page == "PROGDES") {
} else if (page == "PROGPREF" or page == "PROGTO" or page == "PROGCLB" or page == "PROGCRZ" or page == "PROGDES" or page == "PROGAPPR" or page == "PROGDONE") {
if (fmgc.FMGCInternal.phase == 0) {
setprop("/MCDU[" ~ i ~ "]/page", "PROGPREF");
page = "PROGPREF";
@ -3589,9 +3846,15 @@ var canvas_MCDU_base = {
} else if (fmgc.FMGCInternal.phase == 3) {
setprop("/MCDU[" ~ i ~ "]/page", "PROGCRZ");
page = "PROGCRZ";
} else if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
} else if (fmgc.FMGCInternal.phase == 4) {
setprop("/MCDU[" ~ i ~ "]/page", "PROGDES");
page = "PROGDES";
} else if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
setprop("/MCDU[" ~ i ~ "]/page", "PROGAPPR");
page = "PROGAPPR";
} else if (fmgc.FMGCInternal.phase == 7) {
setprop("/MCDU[" ~ i ~ "]/page", "PROGDONE");
page = "PROGDONE";
}
if (!pageSwitch[i].getBoolValue()) {
@ -3622,18 +3885,22 @@ var canvas_MCDU_base = {
colortext[0] = "CRUISE";
} else if (page == "PROGDES") {
colortext[0] = "DESCENT";
} else if (page == "PROGAPPR") {
colortext[0] = "APPROACH";
} else if (page == "PROGDONE") {
colortext[0] = "DONE";
}
colortext[1] = (fmgc.FMGCInternal.flightNumSet) ? fmgc.FMGCInternal.flightNum ~ " " : ""; # push title a little left
colortext[1] = (fmgc.FMGCInternal.flightNumSet and page != "PROGDONE") ? fmgc.FMGCInternal.flightNum : ""; #CHECKME - condition useful?
me["Simple_Title"].setText(colortext[0] ~ sprintf("%" ~ (size(colortext[1])+1) ~ "s"," "));
me["Simple_Title2"].setText(sprintf("%" ~ (size(colortext[0])+1) ~ "s"," ") ~ colortext[1]);
me["Simple_Title"].setText(sprintf(" %-21s",colortext[0]));
me["Simple_Title2"].setText(sprintf("%12s %-11s","",colortext[1]));
me["Simple_Title"].show();
me["Simple_Title"].setColor(GREEN);
me["Simple_Title"].setColor((page != "PROGDONE") ? GREEN : WHITE);
me["Simple_Title2"].show();
me["Simple_Title2"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
#me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
@ -3655,20 +3922,11 @@ var canvas_MCDU_base = {
me.fontRight(default, symbol, symbol, symbol, default, default);
me.fontRightS(default, default, default, default, default, default);
if (page == "PROGCRZ") {
me.showLeftS(0, 0, -1, 0, 0, 0);
me.showCenterS(0, 0, 1, 0, 0, 0);
#me.showRight(0, 0, 1, 0, 0, 0); #Add when implement cruise phase
me.fontLeft(0, 0, default, 0, 0, 0);
} else if (page == "PROGDES") {
me.showRight(0, 1, 0, 0, 0, 0);
}
me.fontSizeLeft(normal, normal, small, small, normal, small);
me.fontSizeLeftS(small, small, small, small, small, small);
me.fontSizeRight(normal, small, small, small, normal, small);
me.fontSizeRightS(small, small, small, small, small, small);
me.fontSizeCenter(small, small, small, small, small, normal);
me.fontSizeCenter(small, normal, small, small, small, normal);
me.fontSizeCenterS(normal, small, small, small, small, small);
me["Simple_C1S"].setFontSize(small);
@ -3676,12 +3934,36 @@ var canvas_MCDU_base = {
me.colorLeft("blu", "wht", "blu", "wht", "wht", "blu");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRight("mag", "blu", "blu", "blu", "grn", "grn");
me.colorRight("mag", "wht", "blu", "blu", "grn", "grn");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("grn", "wht", "wht", "wht", "wht", "grn");
me.colorCenter("grn", "grn", "wht", "wht", "wht", "grn");
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
if (page == "PROGCRZ") {
me.showLeftS(0, 0, -1, 0, 0, 0);
me.showCenterS(0, 0, 1, 0, 0, 0);
#me.showRight(0, 0, 1, 0, 0, 0); #Add when implement cruise phase
me.fontLeft(0, 0, default, 0, 0, 0);
} else if (page == "PROGDES" or page == "PROGAPPR") {
me.showCenter(0, 1, 0, 0, 0, 0);
me.showRight(0, 1, 0, 0, 0, 0);
#me["Simple_C2"].setFontSize(normal);
#me["Simple_R2"].setFontSize(normal);
}
#else if (page == "PROGAPPR") { # A/C without GPS
# me["Simple_L5S"].setFontSize(small);
# me["Simple_L5S"].setColor(GREEN);
# me["Simple_L5"].setFontSize(small);
# me["Simple_L5"].setColor(GREEN);
# me["Simple_R5S"].setFontSize(small);
# me["Simple_R5S"].setColor(WHITE);
# me["Simple_R5S"].show();
# me["Simple_R5"].setFontSize(small);
# me["Simple_R5"].setColor(WHITE);
# me.showLeftArrow(-1, 1, -1, -1, -1, -1);
#}
pageSwitch[i].setBoolValue(1);
}
@ -3692,7 +3974,7 @@ var canvas_MCDU_base = {
me["Simple_L1"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzProg));
}
} else {
me["Simple_L1"].setText("----");
me["Simple_L1"].setText("-----");
}
me["Simple_L2"].setText(" REPORT");
if (page == "PROGCRZ") {
@ -3703,7 +3985,6 @@ var canvas_MCDU_base = {
me["PROG_UPDATE"].show();
me["Simple_L3"].setText(" [ ]");
}
me["Simple_L4"].setText(" ---g /----.-");
me["Simple_L5"].setText(" GPS");
me["Simple_L6"].setText("----");
me["Simple_L1S"].setText(" CRZ");
@ -3711,19 +3992,61 @@ var canvas_MCDU_base = {
me["Simple_L4S"].setText(" BRG /DIST");
me["Simple_L5S"].setText(" PREDICTIVE");
me["Simple_L6S"].setText("REQUIRED");
if (page != "PROGDONE") {
me["Simple_R1"].setText("FL398 ");
me["Simple_R2"].setText("VDEV = + 750 FT");
} else {
me["Simple_L1"].setText("_____");
me["Simple_R1"].setText("----- ");
me["Simple_L1"].setColor(AMBER);
me["Simple_C1"].setColor(WHITE);
me["Simple_R1"].setColor(WHITE);
me["Simple_R5"].hide();
}
if (page == "PROGDES" or page == "PROGAPPR") {
var vdev = 750; #CHECKME i dunno the meaning, but I found this value in the source
var vdev_sign = (vdev>=0) ? "+" : "-";
me["Simple_C2"].setText(sprintf("%17s%4d ",vdev_sign,abs(vdev)));
me["Simple_R2"].setText(sprintf("%30s","VDEV= FT "));
}
if (mcdu.bearingDistances[i].displayID != nil) {
me["Simple_R4"].setFont(default);
me["Simple_R4"].setFontSize(normal);
me["Simple_R4"].setText(mcdu.bearingDistances[i].displayID);
} else {
me["Simple_R4"].setFont(symbol);
me["Simple_R4"].setFontSize(small);
me["Simple_R4"].setText("[ ]");
}
if (mcdu.bearingDistances[i].selectedPoint != nil) {
me["Simple_L4"].setColor(GREEN);
me["Simple_L4"].setText(sprintf("%3.0fg /%4.1f",mcdu.bearingDistances[i].bearing,mcdu.bearingDistances[i].distance));
} else {
me["Simple_L4"].setColor(WHITE);
me["Simple_L4"].setText(" ---g /----.-");
}
me["Simple_R5"].setText("GPS PRIMARY");
me["Simple_R6"].setText("----");
me["Simple_R1S"].setText("REC MAX ");
me["Simple_R6S"].setText("ESTIMATED");
me["Simple_C1"].setText("----");
me["Simple_C1"].setText("-----");
me["Simple_C1S"].setText("OPT");
me["Simple_C3S"].setText("CONFIRM UPDATE AT");
me["Simple_C4"].setText(" TO");
me["Simple_C6S"].setText("ACCUR");
me["Simple_C6"].setText("HIGH");
if (systems.ADIRS.Operating.aligned[0].getValue() or systems.ADIRS.Operating.aligned[1].getValue()) me["Simple_C6"].setText("HIGH");
else me["Simple_C6"].setText("LOW");
#if (page == "PROGAPPR") { # A/C without GPS
# me["Simple_L5"].setText(sprintf(" DIR DIST TO DEST=%6d",0));
# me["Simple_L5S"].setText(sprintf("REQD DIST TO LAND=%6d",0));
# me["Simple_R5"].setText("MN");
# me["Simple_R5S"].setText("MN");
#}
} else if (page == "PERFTO") {
if (!pageSwitch[i].getBoolValue()) {
@ -3818,7 +4141,7 @@ var canvas_MCDU_base = {
me["Simple_L6S"].hide();
}
if (fmgc.FMGCInternal.phase > 0) { # not modifiable from TO phase
if (fmgc.FMGCInternal.phase == 1) { # GREEN title and not modifiable on TO phase
me["Simple_Title"].setColor(GREEN);
me.colorLeft("grn", "grn", "grn", "blu", "grn", "wht");
me.colorRight("grn", "blu", "grn", "grn", "grn", "wht");
@ -3911,6 +4234,7 @@ var canvas_MCDU_base = {
me["Simple_C1S"].setText("FLP RETR");
me["Simple_C2S"].setText("SLT RETR");
me["Simple_C3S"].setText("CLEAN ");
} else if (page == "PERFCLB") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
@ -4065,6 +4389,7 @@ var canvas_MCDU_base = {
me["Simple_R6S"].setText("NEXT ");
me["Simple_R6"].setText("PHASE ");
} else if (page == "PERFCRZ") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
@ -4360,6 +4685,7 @@ var canvas_MCDU_base = {
me["Simple_R6S"].setText("NEXT ");
me["Simple_R6"].setText("PHASE ");
} else if (page == "PERFAPPR") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
@ -4543,6 +4869,7 @@ var canvas_MCDU_base = {
me["Simple_C2S"].setText("SLT RETR");
me["Simple_C3S"].setText("CLEAN ");
me["Simple_C5S"].setText("VLS ");
} else if (page == "PERFGA") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
@ -4860,6 +5187,8 @@ var canvas_MCDU_base = {
me.dynamicPageArrowFunc(myVertRev[i]);
me.colorLeftArrow(myVertRev[i].arrowsColour[0][0],myVertRev[i].arrowsColour[0][1],myVertRev[i].arrowsColour[0][2],myVertRev[i].arrowsColour[0][3],myVertRev[i].arrowsColour[0][4],myVertRev[i].arrowsColour[0][5]);
me.colorRightArrow(myVertRev[i].arrowsColour[1][0],myVertRev[i].arrowsColour[1][1],myVertRev[i].arrowsColour[1][2],myVertRev[i].arrowsColour[1][3],myVertRev[i].arrowsColour[1][4],myVertRev[i].arrowsColour[1][5]);
me.dynamicPageFontFunc(myVertRev[i]);
@ -5921,6 +6250,46 @@ var canvas_MCDU_base = {
me["Simple_L6S"].setFont(f);
}
},
fontCenter: func (a, b, c, d, e, f) {
if (a != 0) {
me["Simple_C1"].setFont(a);
}
if (b != 0) {
me["Simple_C2"].setFont(b);
}
if (c != 0) {
me["Simple_C3"].setFont(c);
}
if (d != 0) {
me["Simple_C4"].setFont(d);
}
if (e != 0) {
me["Simple_C5"].setFont(e);
}
if (f != 0) {
me["Simple_C6"].setFont(f);
}
},
fontCenterS: func (a, b, c, d, e, f) {
if (a != 0) {
me["Simple_C1S"].setFont(a);
}
if (b != 0) {
me["Simple_C2S"].setFont(b);
}
if (c != 0) {
me["Simple_C3S"].setFont(c);
}
if (d != 0) {
me["Simple_C4S"].setFont(d);
}
if (e != 0) {
me["Simple_C5S"].setFont(e);
}
if (f != 0) {
me["Simple_C6S"].setFont(f);
}
},
fontRight: func (a, b, c, d, e, f) {
if (a != 0) {
me["Simple_R1"].setFont(a);

View file

@ -180,6 +180,17 @@ var canvas_nd_base = {
},
};
var ND_change_timer_fn = func {
#me.change_phase += 1;
#if (me.change_phase>2) { # phase 3 - only for older ND?
#if (me.change_phase>1) { # phase 2 hide
me.change_timer.stop();
me.change_phase = 0;
#} else {
me.map.setVisible(1); # phase 2
#}
};
var canvas_ND_1 = {
new: func(canvas_group) {
var m = {parents: [canvas_ND_1, canvas_nd_base]};
@ -190,6 +201,8 @@ var canvas_ND_1 = {
me.NDCpt.attitude_heading_setting = -1;
me.NDCpt.adirs_property = props.globals.getNode("/instrumentation/efis[0]/nd/ir-1",1);
me.NDCpt.newMFD(canvas_group);
me.NDCpt.change_phase = 0;
me.NDCpt.change_timer = maketimer(0.6,me.NDCpt,ND_change_timer_fn);
me.NDCpt.update();
return m;
@ -213,6 +226,8 @@ var canvas_ND_2 = {
me.NDFo.attitude_heading_setting = 1;
me.NDFo.adirs_property = props.globals.getNode("/instrumentation/efis[1]/nd/ir-2",1);
me.NDFo.newMFD(canvas_group);
me.NDFo.change_phase = 0;
me.NDFo.change_timer = maketimer(0.4,me.NDFo,ND_change_timer_fn);
me.NDFo.update();
return m;
@ -338,6 +353,56 @@ setlistener("sim/signals/fdm-initialized", func {
ND_2 = canvas_ND_2.new(group_nd2);
ND_2_test = canvas_ND_2_test.new(group_nd2_test, "Aircraft/A320-family/Models/Instruments/Common/res/du-test.svg");
setlistener("/instrumentation/efis[0]/inputs/range-nm", func() {
canvas_nd.ND_1.NDCpt.trafficLayer.camera.range = getprop("/instrumentation/efis[0]/inputs/range-nm");
}, 1, 0);
setlistener("/instrumentation/efis[1]/inputs/range-nm", func() {
canvas_nd.ND_2.NDFo.trafficLayer.camera.range = getprop("/instrumentation/efis[1]/inputs/range-nm");
}, 1, 0);
setlistener("/instrumentation/efis[0]/inputs/nd-centered", func() {
canvas_nd.ND_1.NDCpt.trafficLayer.camera.screenRange = getprop("/instrumentation/efis[0]/inputs/nd-centered") ? 436.8545 : 710;
canvas_nd.ND_1.NDCpt.trafficLayer.camera.screenCY = getprop("/instrumentation/efis[0]/inputs/nd-centered") ? 512 : 850;
}, 1, 0);
setlistener("/instrumentation/efis[1]/inputs/nd-centered", func() {
canvas_nd.ND_2.NDFo.trafficLayer.camera.screenRange = getprop("/instrumentation/efis[1]/inputs/nd-centered") ? 436.8545 : 710;
canvas_nd.ND_2.NDFo.trafficLayer.camera.screenCY = getprop("/instrumentation/efis[1]/inputs/nd-centered") ? 512 : 850;
}, 1, 0);
setlistener("/instrumentation/tcas/inputs/mode", func() {
if (getprop("/instrumentation/efis[0]/nd/canvas-display-mode") != "PLAN") {
canvas_nd.ND_1.NDCpt.trafficGroup.setVisible(pts.Instrumentation.TCAS.Inputs.mode.getValue() >= 2 ? 1 : 0);
}
if (getprop("/instrumentation/efis[1]/nd/canvas-display-mode") != "PLAN") {
canvas_nd.ND_2.NDFo.trafficGroup.setVisible(pts.Instrumentation.TCAS.Inputs.mode.getValue() >= 2 ? 1 : 0);
}
}, 1, 0);
setlistener("/instrumentation/efis[0]/nd/canvas-display-mode", func() {
canvas_nd.ND_1.NDCpt.trafficGroup.setVisible(getprop("/instrumentation/efis[0]/nd/canvas-display-mode") == "PLAN" ? 0 : 1);
}, 1, 0);
setlistener("/instrumentation/efis[1]/nd/canvas-display-mode", func() {
canvas_nd.ND_2.NDFo.trafficGroup.setVisible(getprop("/instrumentation/efis[1]/nd/canvas-display-mode") == "PLAN" ? 0 : 1);
}, 1, 0);
setlistener("/instrumentation/efis[0]/nd/display-mode", func {
startChangePhase(canvas_nd.ND_1.NDCpt,"MODE CHANGE");
},0,0);
setlistener("/instrumentation/efis[0]/inputs/range-nm", func {
startChangePhase(canvas_nd.ND_1.NDCpt,"RANGE CHANGE");
},0,0);
setlistener("/instrumentation/efis[1]/nd/display-mode", func {
startChangePhase(canvas_nd.ND_2.NDFo,"MODE CHANGE");
},0,0);
setlistener("/instrumentation/efis[1]/inputs/range-nm", func {
startChangePhase(canvas_nd.ND_2.NDFo,"RANGE CHANGE");
},0,0);
nd_update.start();
if (getprop("systems/acconfig/options/nd-rate") > 1) {
rateApply();
@ -382,14 +447,22 @@ for (i = 0; i < 2; i = i + 1 ) {
});
}
setlistener("/instrumentation/efis[0]/nd/terrain-on-nd", func{
var terr_on_hd = getprop("instrumentation/efis[0]/nd/terrain-on-nd");
var alpha = 1;
if (terr_on_hd) {
alpha = 0.5;
var startChangePhase = func(nd,txt) {
nd.change_timer.stop();
nd.map.setVisible(0);
nd.symbols.nd_msg_change.setText(txt);
nd.change_phase = 1;
nd.change_timer.start();
}
nd_display.main.setColorBackground(0,0,0,alpha);
});
#setlistener("/instrumentation/efis[0]/nd/terrain-on-nd", func{
# var terr_on_hd = getprop("instrumentation/efis[0]/nd/terrain-on-nd");
# var alpha = 1;
# if (terr_on_hd) {
# alpha = 0.5;
# }
# nd_display.main.setColorBackground(0,0,0,alpha);
#});
setlistener("/flight-management/control/capture-leg", func(n) {
var capture_leg = n.getValue();

View file

@ -13,6 +13,110 @@ var assert_m = canvas.assert_m;
var wxr_live_tree = "/instrumentation/wxr";
var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1);
var easeArrow = {
new: func(elem) {
var m = {parents: [easeArrow]};
m.req_rot_rad = 0;
m.req_rot_deg = 0;
m.last_rot_deg = nil;
m.last_rot_rad = 0;
m.element = elem;
m.time = 0;
m.duration = 0;
m.startval = 0;
m.diffval = 0;
return m;
},
setVisible: func(v) {
if (v == 1 and me.last_rot_deg == nil) me.reset();
me.element.setVisible(v);
},
hide: func {
me.element.hide();
},
reset: func {
me.last_rot_deg = 360 - getprop("orientation/heading-deg");
me.last_rot_rad = me.last_rot_deg * D2R;
me.duration = 0;
print("VOR reset");
},
setRotation: func(rad) {
var deg = 0;
var gap = 0;
gap = math.abs(rad - me.req_rot_rad);
if (gap>0.001) {
if (me.duration>0) gap = math.abs(rad - me.last_rot_rad);
if (gap>=180*D2R) gap = 360*D2R - gap;
deg = rad * 57.29578;
me.req_rot_rad = rad;
me.req_rot_deg = deg;
me.duration = 0;
if (gap>0.2) {
if (me.last_rot_deg == nil) me.reset();
me.startval = me.last_rot_deg;
me.diffval = deg - me.last_rot_deg;
if (me.diffval<0) me.diffval += 360;
me.time = 0;
me.duration = math.round(me.diffval * 0.21); # rad 36/3
}
if (me.duration < 2) {
me.last_rot_rad = rad;
me.last_rot_deg = deg;
me.element.setRotation(rad);
me.duration = 0;
}
}
if (me.duration > 0) {
var tx = me.time / me.duration;
#thanks to https://easings.net/#easeOutCubic
deg = (1 - math.pow(1 - tx, 3)) * me.diffval + me.startval;
deg = math.mod(deg,360);
#print("DEG: " ~ deg);
me.last_rot_deg = deg;
me.last_rot_rad = deg * D2R;
me.element.setRotation(me.last_rot_rad);
me.time += 1;
if (tx>=1) me.duration = 0;
}
}
};
var symbolDistNM = {
new: func(name, nd) {
var m = {parents: [symbolDistNM] };
m.group = nd.getElementById(name);
m.expn = nd.getElementById(name ~ "1");
m.mant = nd.getElementById(name ~ "2");
return m;
},
hide: func {
me.group.hide();
},
show: func {
me.group.show();
},
setText: func(txt) {
var parts = ( txt != "" ) ? split( "." , txt ) : nil;
if ( parts != nil and size(parts) == 2 ) {
me.expn.setText(parts[0]);
me.mant.setText("." ~ parts[1]);
} else {
me.expn.setText(txt);
me.mant.setText("");
}
},
setColor: func(r,g,b) {
me.expn.setColor(r,g,b);
me.mant.setColor(r,g,b);
},
setFloat: func(val) {
var parts = split( "." , sprintf("%03.1f",val) );
me.expn.setText(parts[0]);
me.mant.setText("." ~ parts[1]);
}
};
canvas.NavDisplay.set_switch = func(s, v) {
var switch = me.efis_switches[s];
if(switch == nil) return nil;
@ -32,8 +136,7 @@ canvas.NavDisplay.get_nav_path = func (type, idx) {
return sprintf(path, name, idx);
};
canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update_time=0.05)
{
canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update_time=0.05) {
if (me.inited) die("MFD already was added to scene");
me.range_dependant_layers = [];
me.always_update_layers = {};
@ -69,24 +172,35 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
### this is the "old" method that"s less flexible, we want to use the style hash instead (see above)
# because things are much better configurable that way
# now look up all required SVG elements and initialize member fields using the same name to have a convenient handle
foreach(var element; ["dmeLDist","dmeRDist","dmeL","dmeR","vorL","vorR","vorLId","vorRId",
"status.wxr","status.wpt","status.sta","status.arpt"])
foreach(var element; ["dmeL","dmeR","vorL","vorR","vorLId","vorRId",
"status.wxr","status.wpt","status.sta","status.arpt","terrHI","terrLO","TerrLabel","terrAhead"])
me.symbols[element] = me.nd.getElementById(element);
foreach(var element; ["dmeLDist","dmeRDist"])
me.symbols[element] = symbolDistNM.new( element, me.nd );
me.symbols.dmeLDist.setColor(0.195,0.96,0.097);
me.symbols.dmeRDist.setColor(0.195,0.96,0.097);
# load elements from vector image, and create instance variables using identical names, and call updateCenter() on each
# anything that needs updatecenter called, should be added to the vector here
#
foreach(var element; ["staArrowL2","staArrowR2","staFromL2","staToL2","staFromR2","staToR2",
foreach(var element; ["staFromL2","staToL2","staFromR2","staToR2",
"hdgTrk","trkInd","hdgBug","HdgBugCRT","TrkBugLCD","HdgBugLCD","curHdgPtr",
"HdgBugCRT2","TrkBugLCD2","HdgBugLCD2","hdgBug2","selHdgLine","selHdgLine2","curHdgPtr2",
"staArrowL","staArrowR","staToL","staFromL","staToR","staFromR"] )
"staToL","staFromL","staToR","staFromR"] )
me.symbols[element] = me.nd.getElementById(element).updateCenter();
foreach(var element; ["staArrowL2","staArrowR2","staArrowL","staArrowR"] )
me.symbols[element] = easeArrow.new( me.nd.getElementById(element).updateCenter() );
me.map = me.nd.createChild("map","map")
.set("clip", "rect(124, 1024, 1024, 0)")
.set("screen-range", 700)
.set("z-index",-1);
me.compassHdgTrk = 0; # last compass rotation deg
me.update_sub(); # init some map properties based on switches
var vor1_path = "/instrumentation/nav[2]";
@ -233,6 +347,17 @@ canvas.NavDisplay.newMFD = func(canvas_group, parent=nil, nd_options=nil, update
event_handler();
} # foreach layer
me.mapCamera = traffic.Camera.new({
range: 20,
screenRange: 436.8545,
screenCX: 512,
screenCY: 512,
});
me.trafficGroup = me.nd.createChild("group");
me.trafficLayer = traffic.TrafficLayer.new(me.mapCamera, me.trafficGroup);
me.trafficLayer.start();
me.trafficGroup.set("z-index", -1);
#print("navdisplay.mfd:ND layer setup completed");
# TODO: move this to RTE.lcontroller ?
@ -277,20 +402,38 @@ canvas.NavDisplay.update_sub = func(){
me.userTrk=userHdg;
}
var reqHdg = 0;
if((me.in_mode("toggle_display_mode", ["MAP"]) and me.get_switch("toggle_display_type") == "CRT")
or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD"))
{
or (me.get_switch("toggle_track_heading") and me.get_switch("toggle_display_type") == "LCD")) {
userHdgTrk = userTrk;
me.userHdgTrk = userTrk;
me.compassHdgTrk = userTrk;
userHdgTrkTru = userTrkTru;
me.symbols.hdgTrk.setText("TRK");
} else {
userHdgTrk = userHdg;
me.userHdgTrk = userHdg;
if (userHdg != me.compassHdgTrk) {
var dist = userHdg - me.compassHdgTrk;
if (dist>180) dist = dist - 360;
elsif (dist<-180) dist = 360 + dist;
if (dist>0) {
dist = dist * 0.3;
if (dist>10) dist = 10;
me.compassHdgTrk = (dist<0.1) ? userHdg : math.mod(me.compassHdgTrk+dist,360);
}
elsif (dist<0) {
dist = dist * 0.3;
if (dist<-10) dist = -10;
me.compassHdgTrk = (dist>-0.1) ? userHdg : math.mod(me.compassHdgTrk+dist,360);
}
}
userHdgTrk = me.compassHdgTrk;
me.userHdgTrk = me.compassHdgTrk;
userHdgTrkTru = userHdgTru;
me.symbols.hdgTrk.setText("HDG");
}
# First, update the display position of the map
var oldRange = me.map.getRange();
var pos = {
@ -372,6 +515,13 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
else
me.map.setTranslation(512,824);
}
me.mapCamera.repositon(geo.aircraft_position(), me.aircraft_source.get_hdg_tru());
me.pos = props.globals.getNode("position");
me.trafficLayer.setRefAlt(me.pos.getValue("altitude-ft"));
if (me.trafficGroup.getVisible()) {
me.trafficLayer.update();
me.trafficLayer.redraw();
}
var vor1_path = "/instrumentation/nav[2]";
var vor2_path = "/instrumentation/nav[3]";
var dme1_path = "/instrumentation/dme[2]";
@ -462,7 +612,7 @@ canvas.NavDisplay.update = func() # FIXME: This stuff is still too aircraft spec
var adf1hdg = getprop("/instrumentation/adf[1]/indicated-bearing-deg");
if(!me.get_switch("toggle_centered"))
{
if(me.in_mode("toggle_display_mode", ["PLAN"]) or (me.adirs_property.getValue() != 1 and (adirs_3.getValue() != 1 or att_switch.getValue() != me.attitude_heading_setting)))
if(me.in_mode("toggle_display_mode", ["PLAN"]) or (me.adirs_property.getValue() != 1 or (me.change_phase == 1) and (adirs_3.getValue() != 1 or att_switch.getValue() != me.attitude_heading_setting)))
me.symbols.trkInd.hide();
else
me.symbols.trkInd.show();

View file

@ -0,0 +1,51 @@
# See: http://wiki.flightgear.org/MapStructure
# Class things:
var name = 'TERRAIN';
var parents = [canvas.SymbolLayer.Controller];
var __self__ = caller(0)[0];
canvas.SymbolLayer.Controller.add(name, __self__);
canvas.SymbolLayer.add(name, {
parents: [MultiSymbolLayer],
type: name, # Symbol type
df_controller: __self__, # controller to use by default -- this one
df_options: { # default configuration options
viewport_radius: 670
}
});
var new = func(layer) {
var m = {
parents: [__self__],
layer: layer,
map: layer.map,
listeners: [],
};
layer.searcher._equals = func(l,r) l.equals(r);
m.addVisibilityListener();
return m;
};
var del = func() {
#print(name~".lcontroller.del()");
foreach (var l; me.listeners)
removelistener(l);
};
var searchCmd = func {
if(me.map.getRange() == nil) return [];
var pos = geo.aircraft_position();
lat = pos.lat();
lon = pos.lon();
var result = geo.Coord.new();
result.set_latlon(lat, lon);
result.rangeNm = me.map.getRange();
result.fetchRad = 184; # is this number accurate?
result.equals = func(r){
me.fetchRad == r.fetchRad and me.lat == r.lat and me.lon == r.lon
};
return [result];
};

View file

@ -0,0 +1,429 @@
# See: http://wiki.flightgear.org/MapStructure
# Class things:
## Airbus Terrain on ND by InuYaksa*2021
## EGPWS device - Applicable to: MSN 0112
## Ident.: DSC-31-45-00009586.0012001 / 22 MAY 12
## Ident.: DSC-31-45-00009586.0009001 / 08 AUG 13
## inspired from work on 787-family - thanks a lots
## and a great help from legoboyvdlp
var name = 'TERRAIN';
var parents = [DotSym];
var __self__ = caller(0)[0];
DotSym.makeinstance( name, __self__ );
var element_type = "group";
var terrain_minalt = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/min-altitude", 0,"INT");
var terrain_maxalt = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-altitude", -9999,"INT");
var terrain_maxcol = props.globals.initNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-color", 0,"INT"); # 0= grn, 1= yel, 2= red
var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode");
var tile_list = [
nil,"tile_gl.png","tile_gh.png","tile_al.png","tile_ah.png","tile_rh.png", # 0-5 low alt - imho real ND displays as amber-ish color than yellow one
"tile_gl.png","tile_gh.png","tile_gh.png","tile_gs.png", # 6-9 hi alt
"tile_ml.png","tile_cl.png", # 10 magenta - 11 cyan-ish/blue (water)
"tile_as.png","tile_rs.png" # 12-13 alert - solid colors
];
var is_terrain = 0;
var get_elevation = func (lat, lon) {
var info = geodinfo(lat, lon);
var elevation = 0;
if (info != nil) {
elevation = int(info[0] * 3.2808399);
me.is_terrain = (info[1] == nil) ? 1 : info[1].solid;
}
else { elevation = nil; }
return elevation;
}
var updateTerrain = func {
if (me.reference == nil) return;
if(me.fetching) return;
me.fetching = 1;
if (me.request_clear == 1) {
me.request_clear = 0;
me.clear();
me.group.setVisible(1);
}
var RAD2DEG = 57.2957795;
var DEG2RAD = 0.016774532925;
var pos_lat = me.reference.lat();
var pos_lon = me.reference.lon();
var heading = me.refheading;
var altitudeft = me.refaltitudeft;
var lowaltft = me.reflowaltft;
var basealtft = me.basealtitudeft;
var alert_level = me.terrain_alert.getValue();
var side = (math.mod(me.radar_beacon,2)==0) ? "L" : "R";
var a = int(me.radar_beacon/2);
var col = a + 0.5;
if (side == "R") {
col = -col;
}
var trn = me.terrlayer[side ~ a];
var len = size(trn);
var range = me.range;
var tiles = me.tile_list;
#var proj_lon = pos_lon + ((col * (range/30) * math.sin(DEG2RAD * (heading - 90))) / 40);
#var proj_lat = pos_lat + ((col * (range/30) * math.cos(DEG2RAD * (heading - 90))) / 40);
# if me.tileradiusw == 20
var range_20f = range / 18.75;
var heading_sin = math.sin(DEG2RAD * heading);
var heading_cos = math.cos(DEG2RAD * heading);
var proj_lon = pos_lon + ((col * range_20f * math.sin(DEG2RAD * (heading - 90))) / 60);
var proj_lat = pos_lat + ((col * range_20f * math.cos(DEG2RAD * (heading - 90))) / 60);
var elevft = [];
me.radar_cleared = 0;
for (var row = 0; row < len; row += 1) {
if (trn[row] == nil) {
append(elevft,-1);
continue;
}
var point_lon = proj_lon + ((row * range_20f / 60) * heading_sin);
var point_lat = proj_lat + ((row * range_20f / 60) * heading_cos);
var elev = me.get_elevation(point_lat, point_lon);
var grad = 0; #black
if (elev != nil) {
if (elev>me.max_altitude) me.max_altitude = elev;
if (me.is_terrain) {
if (elev<me.min_altitude) me.min_altitude = elev;
if (elev < basealtft) grad = 0; # < 400 near runway use blank
else {
var diff = elev - altitudeft;
if (diff>=0) {
grad = int(diff/1000) + 3;
if (grad>5) grad = 5;
if (alert_level > 0 and a < 6 and grad > 3) {
if (alert_level == 1 and (grad == 3 or grad == 4)) grad = 12; # solid yellow
else if (alert_level == 2 and grad == 5) grad = 13; # solid red
}
} else {
if (me.hialtmode == 0) {
if (diff>=lowaltft) grad = 3; # lite yellow
else {
grad = int(diff/1000) + 2;
if (grad<0) grad = 0;
}
} else {
if (diff>=lowaltft) grad = 3; # lite yellow
else {
if (me.bands_range > 0 and elev > me.bands_minalt) {
grad = 9 - int((me.bands_maxalt - elev) / me.bands_range);
if (grad>9) grad = 9; # solid green
else if (grad<6) grad = 6; #light green
}
}
}
}
}
} else {
grad = 11; #water/cyan
}
append(elevft,grad); # 0-5
} else {
append(elevft,0); # no data - black (magenta)
}
}
if (me.min_altitude > me.max_altitude) me.min_altitude = me.max_altitude; # occurs on sea areas
for (var r=0; r < len; r+=1) {
var imgx = elevft[r];
if (imgx == -1) continue;
if (imgx < 1) trn[r].hide();
else trn[r].setFile(me.imgpath ~ me.tile_list[imgx]).show();
}
me.radar_beacon += 1;
if (me.radar_beacon >= (me.tileradiusw*2)) {
me.restart_beacon();
}
me.fetching = 0;
};
var update_altitudes = func {
me.terrain_minalt.setValue(me.min_altitude);
me.terrain_maxalt.setValue(me.max_altitude);
var altdif = me.max_altitude - me.refaltitudeft;
if (altdif <= 0) {
if (altdif >= me.reflowaltft) me.terrain_maxcol.setValue(1);
else me.terrain_maxcol.setValue(0);
} else {
if (altdif>2000) me.terrain_maxcol.setValue(2);
else me.terrain_maxcol.setValue(1);
}
if (me.min_altitude == 9999) {
me.avg_minalt = me.min_altitude;
me.avg_maxalt = me.max_altitude;
} else {
#if (me.min_altitude < me.avg_minalt) me.avg_minalt = me.min_altitude;else
me.avg_minalt = math.round((me.avg_minalt * 2 + me.min_altitude) / 3);
#if (me.max_altitude > me.avg_maxalt) me.avg_maxalt = me.max_altitude;else
me.avg_maxalt = math.round((me.avg_maxalt * 2 + me.max_altitude) / 3);
}
me.avg_peakalt = me.avg_maxalt - me.avg_minalt;
if (me.onground == 0 and (me.max_altitude + 250) < me.refaltitudeft) { # 250 ft tollerance
me.hialtmode = 1;
var range = math.min(2400,(me.avg_maxalt - me.avg_minalt)) - 400;
if (range < 400) { # min elev number
me.bands_range = 0;
} else {
me.bands_range = int(range / 4);
me.bands_maxalt = me.avg_maxalt;
me.bands_minalt = math.max( me.avg_maxalt - range, me.avg_minalt + 400 );
}
} else {
me.hialtmode = 0;
#me.avg_minalt = 9999;
}
me.min_altitude = 9999;
me.max_altitude = -9999;
}
var restart_beacon = func {
me.radar_beacon = 0;
me.radar_cycle += 1;
me.reference = nil;
};
var init = func {
#print('TERRAIN init');
me.tile = 33;
me.fetching = 0;
me.fetchRad = me.model.fetchRad; # Radius of radar layer to fetch
me.range = me.model.rangeNm; # Range of Navigation Display
me.viewport_radius = me.getOption('viewport_radius', 670);
me.imgpath = get_local_path('res/terrainv2/');
me.radar_beacon = 0;
me.radar_cycle = 0;
me.radar_cleared = 1;
me.request_clear = 0;
me.min_altitude = 9999;
me.max_altitude = -9999;
me.avg_minalt = 9999;
me.avg_maxalt = -9999;
me.avg_peakalt = nil;
me.maxalt_col = 0; # 0 = grn, 1 = yel, 2 = red
me.bands_minalt = 0;
me.bands_maxalt = 0;
me.bands_range = 0;
me.basealtitudeft = nil;
me.reference = nil;
me.onfailure = 0;
me.hialtmode = 0; # high aircraft relative altitude mode
me.checkarrival = 0;
me.onground = 1;
var tile = me.tile;
var gx = int(me.viewport_radius / tile);
me.tileradius = gx;
var limx = int((512/tile)+0.5); # display width is smaller than height
me.tileradiusw = limx;
me.terrlayer = {};
var centx = 0;
var centy = -me.viewport_radius;
var group = me.group.createChild("group").set("z-index", -100); #me.element
for (var c=0; c<limx; c+=1) {
var hh = c * tile;
var mx = (c == 0) ? gx : int(math.sqrt(gx*gx-c*c) + 0.5);
var my = int(c*4/gx);
var py = centy + (gx-1) * tile;
var pxr = centx+(c*tile);
var pxl = centx-(c*tile)-tile;
var grplx = [];
var grprx = [];
for (var r=0; r<mx; r+=1) {
if (r<my) {
append(grplx , nil); #skip
append(grprx , nil);
} else {
append(grplx , group.createChild("image").setSize(tile,tile).setTranslation(pxl,py).hide());
append(grprx , group.createChild("image").setSize(tile,tile).setTranslation(pxr,py).hide());
}
py-=tile;
}
me.terrlayer["L" ~ c] = grplx;
me.terrlayer["R" ~ c] = grprx;
}
setlistener("/instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit", func{ # detect GPWS switch status
me.onfailure = getprop("/instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit");
},1,0);
};
var clear = func {
if (me.radar_cleared == 0) {
me.radar_cleared = 1;
for (var c=0; c<me.tileradiusw; c+=1 ) {
var rowL = me.terrlayer["L" ~ c];
var rowR = me.terrlayer["R" ~ c];
var len = size(rowL);
for (var r=0; r<len; r+=1) {
if (rowL[r] != nil) {
rowL[r].hide();
rowR[r].hide();
}
}
}
}
}
var draw = func {
if(me.fetching) return;
if (pts.Sim.pause.getBoolValue()) return;
if (me.onfailure == 1) {
me.clear();
me.restart_beacon();
return;
}
if (me.layer.display_changed == 1) {
me.layer.display_changed = 0;
me.clear();
me.min_altitude = 9999;
me.max_altitude = -9999;
terrain_maxalt.setValue(-9999);
me.reference = nil;
}
if (me.reference == nil) { # update aircraft reference
var ref = geo.aircraft_position();
me.reference = ref;
if (ref != nil) {
me.refheading = getprop("orientation/heading-magnetic-deg");
var refalt = int(getprop("/position/altitude-ft")); #int(ref.alt() * 3.2808399);
me.refaltitudeft = refalt;
me.groundaltft = int(getprop("/position/ground-elev-ft"));
me.reflowaltft = (pts.Gear.position[1].getValue()) ? -250 : -500;
me.onground = pts.Gear.wow[0].getValue();
if (me.min_altitude != 9999) me.update_altitudes();
var flatalt = (me.avg_peakalt != nil and me.avg_peakalt>499) ? 400 : 140;
var vspeed30s = int(getprop("velocities/vertical-speed-fps") * 30);
if (vspeed30s<-500) me.refaltitudeft = math.max(me.avg_minalt , me.refaltitudeft + vspeed30s);
if (me.basealtitudeft == nil) { # first basealt set
me.basealtitudeft = me.groundaltft + flatalt;
me.flatalt = flatalt;
me.checkarrival = 1;
print("set REFALT [init]: "~me.basealtitudeft);
} else if (fmgc.FMGCInternal.phase < 2) { # starting at phase < 2
if (me.flatalt != flatalt) {
me.basealtitudeft = me.groundaltft + flatalt;
me.flatalt = flatalt;
print("set REFALT [flat]: "~me.basealtitudeft);
}
} else if (fmgc.FMGCInternal.phase == 5) {
if (me.checkarrival == 1) {
me.checkarrival = 0;
me.basealtitudeft = nil;
if (fmgc.FMGCInternal.arrApt != nil) {
var airport = airportinfo(fmgc.FMGCInternal.arrApt);
if (airport != nil) me.basealtitudeft = flatalt + int(airport.elevation * M2FT);
print("set REFALT [arrApt]: "~me.basealtitudeft);
}
if (me.basealtitudeft == nil) {
me.basealtitudeft = flatalt + me.avg_minalt; # that's fun
}
}
} else if (fmgc.FMGCInternal.phase == 6) {
if (me.checkarrival == 0) {
me.checkarrival = 1;
#me.basealtitudeft = 0;
}
} else if (fmgc.FMGCInternal.phase == 7) {
if (me.checkarrival == 0) {
me.checkarrival = 1;
me.basealtitudeft = me.groundaltft + flatalt;
print("set REFALT [done]: "~me.basealtitudeft);
}
} else if (fmgc.FMGCInternal.phase == 2) {
var expdaltft = me.groundaltft + flatalt;
if (me.basealtitudeft > expdaltft) {
me.basealtitudeft = expdaltft;
print("set REFALT [blwbase]: "~me.basealtitudeft);
}
} else if (fmgc.FMGCInternal.phase >= 2) {
me.basealtitudeft = math.avg(me.basealtitudeft,flatalt + me.groundaltft,int(flatalt + me.avg_minalt));
#if (me.basealtitudeft > me.avg_maxalt) {
# if (me.avg_maxalt < 1000) me.basealtitudeft = 0; # 1000ft min elev number
# else me.basealtitudeft = int(400 + me.avg_minalt);
# print("set REFALT [blwmin]: "~me.basealtitudeft);
#}
#else if (me.basealtitudeft == 0 and me.avg_maxalt >= 1000) { # 1000ft min elev number
# me.basealtitudeft = int(400 + me.avg_minalt);
# print("set REFALT [abvmin]: "~me.basealtitudeft);
#}
}
}
} else {
var range = me.layer.map.getRange(); # Range of Navigation Display
var update_size = (range != me.range);
me.range = range;
if (update_size) {
me.request_clear = 1;
}
me.updateTerrain(); # left
me.updateTerrain(); # right
}
};

View file

@ -7,8 +7,8 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="airbusND_orig.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="airbusND.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)"
xml:space="preserve"
id="svg5180"
height="1024"
@ -23,16 +23,16 @@
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1056"
inkscape:window-height="1017"
id="namedview102"
showgrid="false"
inkscape:zoom="0.9002897"
inkscape:cx="467.92702"
inkscape:cy="538.03817"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:zoom="3.1081105"
inkscape:cx="904.96427"
inkscape:cy="819.41055"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="layer8"
inkscape:current-layer="terrGroup"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-object-midpoints="true"
@ -40,7 +40,8 @@
inkscape:snap-to-guides="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:document-rotation="0"><sodipodi:guide
inkscape:document-rotation="0"
inkscape:snap-text-baseline="true"><sodipodi:guide
id="guide3167"
orientation="1,0"
position="512,811.5" /><sodipodi:guide
@ -58,10 +59,55 @@
id="guide3537" /><sodipodi:guide
orientation="-0.8660254,0.5"
position="512,200"
id="guide3545" /></sodipodi:namedview><metadata
id="guide3545" /><sodipodi:guide
position="-3.9271069,171.8178"
orientation="1,0"
id="guide742" /><sodipodi:guide
position="63.243533,882.27478"
orientation="1,0"
id="guide3109" /><sodipodi:guide
position="59.703006,906.39896"
orientation="0,-1"
id="guide3111" /><sodipodi:guide
position="70.197038,990.32506"
orientation="0,-1"
id="guide3113" /><sodipodi:guide
position="211.67107,1010.2551"
orientation="0,-1"
id="guide3115" /><sodipodi:guide
position="14.137585,913.25558"
orientation="1,0"
id="guide3498" /><sodipodi:guide
position="74.643421,502.13953"
orientation="0,-1"
id="guide3552" /><sodipodi:guide
position="43.434749,95.13984"
orientation="0,-1"
id="guide1262" /><sodipodi:guide
position="23.634,-25.190503"
orientation="-1,0"
id="guide1264"
inkscape:label=""
inkscape:locked="false"
inkscape:color="rgb(0,0,255)" /><sodipodi:guide
position="45.728253,127.63524"
orientation="0,-1"
id="guide1266" /><sodipodi:guide
position="40.040659,26.851076"
orientation="1,0"
id="guide1325" /><sodipodi:guide
position="96.521665,66.50508"
orientation="0,-1"
id="guide1327" /><sodipodi:guide
position="1017.0166,55.726826"
orientation="1,0"
id="guide1344" /><sodipodi:guide
position="978.72968,72.618123"
orientation="1,0"
id="guide1259" /></sodipodi:namedview><metadata
id="metadata5186"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title><dc:creator><cc:Agent><dc:title>Gijs de Rooy</dc:title></cc:Agent></dc:creator><cc:license
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /><dc:creator><cc:Agent><dc:title>Gijs de Rooy</dc:title></cc:Agent></dc:creator><cc:license
rdf:resource="" /></cc:Work></rdf:RDF></metadata><defs
id="defs5184"><marker
style="overflow:visible"
@ -223,7 +269,69 @@
inkscape:connector-curvature="0"
inkscape:transform-center-y="-340.574"
inkscape:label="#path3843"
sodipodi:nodetypes="cc" /><path
sodipodi:nodetypes="cc" /><g
id="terrGroup"
transform="translate(-9.356522,-6.2275037)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="1018.2351"
y="796.34009"
id="terrAhead"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25;text-align:end;text-anchor:end"
sodipodi:role="line"
id="tspan1244"
x="1018.2351"
y="796.34009">TERR</tspan><tspan
style="font-size:24px;line-height:1.25;text-align:end;text-anchor:end"
sodipodi:role="line"
x="1018.2351"
y="826.34009"
id="tspan1248">AHEAD</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="952.74292"
y="826.34009"
id="TerrLabel"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25"
sodipodi:role="line"
id="tspan1994"
x="952.74292"
y="826.34009">TERR</tspan></text><text
inkscape:label="#text7243"
id="terrHI"
y="858.63959"
x="965.73273"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="858.63959"
x="965.73273"
id="tspan2002"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">000</tspan></text><text
inkscape:label="#text7243"
id="terrLO"
y="888.00446"
x="965.73273"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="888.00446"
x="965.73273"
id="tspan2006"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">000</tspan></text><rect
style="fill:none;stroke:#f2f235;stroke-width:3.15591;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2018"
width="67.30439"
height="58.673889"
x="958.45599"
y="833.17212"
ry="0" /><path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#f2f235;stroke-width:3.15591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.9941;stop-color:#000000;stop-opacity:1"
d="m 958.38792,861.87476 67.46618,0.61588"
id="path2033"
sodipodi:nodetypes="cc" /></g><path
sodipodi:nodetypes="cc"
inkscape:label="#path3843"
inkscape:transform-center-y="-340.574"
@ -240,26 +348,26 @@
style="display:inline;fill:none;stroke:#f2f235;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><text
inkscape:label="#text7243"
id="wpActiveId"
y="54.099972"
x="766.04407"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#cecdce;fill-opacity:1;stroke:none"
y="34.099972"
x="908.58118"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#cecdce;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="54.099972"
x="766.04407"
y="34.099972"
x="908.58118"
id="tspan7245"
sodipodi:role="line"
style="font-size:36px;line-height:1.25">ABCD</tspan></text>
style="font-size:36px;line-height:1.25;text-align:end;text-anchor:end">XXXX99X</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="844.04407"
y="88.124893"
x="866.04407"
y="68.124893"
id="wpActiveDist"
inkscape:label="#text7243"><tspan
sodipodi:role="line"
id="tspan7251"
x="844.04407"
y="88.124893"
x="866.04407"
y="68.124893"
style="font-size:36px;line-height:1.25">999.9</tspan></text>
<path
sodipodi:nodetypes="cccc"
@ -267,13 +375,22 @@
id="aplSymMap"
d="m 512,866.4 v -68 m 34.5,24 h -70 m 50,32 h -30"
style="fill:none;stroke:#f2f235;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:label="#path7253" /><path
inkscape:label="#path3017"
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
inkscape:label="#path7253" /><g
id="windArrow"
d="m 75.2914,119.519 -2e-4,65.158 m 0,0 7.0125,-12.145 H 67.4945 l 7.7967,12.146"
style="fill:#0dc04b;stroke:#0dc04b;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><g
transform="matrix(0.81,0,0,0.81,-8.3843096,20.546412)"><path
inkscape:label="#path3017l"
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3107l"
d="M 63.260505,77.514285 63.260317,138.7628"
style="display:inline;fill:#0dc04b;stroke:#0dc04b;stroke-width:4.44444;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:#0dc04b;fill-opacity:1;stroke:#0dc04b;stroke-width:4.44444;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
d="m 53.29087,120.00845 9.969447,18.75435"
id="path1242" /><path
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:#0dc04b;fill-opacity:1;stroke:#0dc04b;stroke-width:4.44444;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
d="M 73.229764,120.00845 63.260317,138.7628"
id="path1244"
sodipodi:nodetypes="cc" /></g><g
inkscape:label="#g3124"
id="compass"
transform="rotate(0.34999975,516.49696,825.81379)"><path
@ -784,63 +901,63 @@
</g><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="36.862175"
y="92.904839"
x="12.862175"
y="72.904839"
id="wind"
inkscape:label="#text7243"><tspan
sodipodi:role="line"
id="tspan3801"
x="36.862175"
y="92.904839"
x="12.862175"
y="72.904839"
style="font-size:36px;line-height:1.25">999°/ 99</tspan></text>
<text
inkscape:label="#text7243"
id="gs"
y="53.306854"
x="101.87437"
y="33.306854"
x="61.874367"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="53.306854"
x="101.87437"
y="33.306854"
x="61.874367"
id="tspan3809"
sodipodi:role="line"
style="font-size:36px;line-height:1.25">999</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="248.49673"
y="53.306854"
x="189.71132"
y="33.306854"
id="tas"
inkscape:label="#text7243"><tspan
sodipodi:role="line"
id="tspan3813"
x="248.49673"
y="53.306854"
x="189.71132"
y="33.306854"
style="font-size:36px;line-height:1.25">999</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none"
x="38.276394"
y="53.306854"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.32193px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none;stroke-width:0.776827"
x="13.895038"
y="33.26786"
id="gsLbl"
inkscape:label="#text7243"><tspan
style="font-size:36px;line-height:1.25"
style="font-size:27.9658px;line-height:1.25;stroke-width:0.776827"
sodipodi:role="line"
id="tspan3817"
x="38.276394"
y="53.306854">GS</tspan></text>
x="13.895038"
y="33.26786">GS</tspan></text>
<text
inkscape:label="#text7243"
id="tasLbl"
y="53.306854"
x="170.17084"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none"
y="33.340725"
x="129.95859"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.32191px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none;stroke-width:0.776826"
xml:space="preserve"><tspan
y="53.306854"
x="170.17084"
y="33.340725"
x="129.95859"
id="tspan3821"
sodipodi:role="line"
style="font-size:36px;line-height:1.25">TAS</tspan></text>
style="font-size:27.9658px;line-height:1.25;stroke-width:0.776826">TAS</tspan></text>
<g
id="hdgGroup"
inkscape:label="#g3141"><path
@ -887,108 +1004,86 @@
</g><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="71.73262"
y="913.5495"
x="39.859375"
y="919.5495"
id="vorL"
inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;fill:#0dc04b;fill-opacity:1"
sodipodi:role="line"
id="tspan3056"
x="71.73262"
y="913.5495">VOR 1</tspan></text>
x="39.859375"
y="919.5495">VOR 1</tspan></text>
<text
inkscape:label="#text7243"
id="dmeL"
y="993.85461"
x="151.73262"
x="87.73262"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="993.85461"
x="151.73262"
x="87.73262"
id="tspan3060"
sodipodi:role="line"
style="font-size:24px;line-height:1.25">NM</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="71.129601"
y="993.85461"
id="dmeLDist"
inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;fill:#0dc04b"
sodipodi:role="line"
id="tspan3068"
x="71.129601"
y="993.85461">99.9</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="71.73262"
y="954.56171"
x="39.9375"
y="956.56171"
id="vorLId"
inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;fill:#0dc04b"
sodipodi:role="line"
id="tspan3072"
x="71.73262"
y="954.56171">ABC</tspan></text>
x="39.9375"
y="956.56171">ABC</tspan></text>
<text
inkscape:label="#text7243"
id="vorR"
y="913.5495"
x="859.7326"
y="919.5495"
x="883.85938"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="913.5495"
x="859.7326"
y="919.5495"
x="883.85938"
id="tspan3076"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">VOR 2</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="931.7326"
x="967.03125"
y="993.85461"
id="dmeR"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25"
sodipodi:role="line"
id="tspan3080"
x="931.7326"
x="967.03125"
y="993.85461">NM</tspan></text>
<text
inkscape:label="#text7243"
id="dmeRDist"
y="993.85461"
x="859.12958"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="993.85461"
x="859.12958"
id="tspan3084"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">99.9</tspan></text>
<text
inkscape:label="#text7243"
id="vorRId"
y="954.56171"
x="859.7326"
y="955.91815"
x="883.9375"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="954.56171"
x="859.7326"
y="955.91815"
x="883.9375"
id="tspan3088"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;fill:#0dc04b">ABC</tspan></text>
<text
inkscape:label="#text7243"
id="eta"
y="126.06245"
y="106.06245"
x="892.04407"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
style="font-size:36px;line-height:1.25"
y="126.06245"
y="106.06245"
x="892.04407"
id="tspan3092"
sodipodi:role="line">08 34.4z</tspan></text>
@ -1173,50 +1268,42 @@
sodipodi:nodetypes="ccccccccc" /></g><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
x="945.04547"
y="87.431412"
x="967.04547"
y="67.431412"
id="wpActiveDistLbl"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25"
sodipodi:role="line"
id="tspan3179"
x="945.04547"
y="87.431412">NM</tspan></text>
x="967.04547"
y="67.431412">NM</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#cecdce;fill-opacity:1;stroke:none"
x="785.289"
y="53.929054"
x="807.289"
y="33.929054"
id="ilsLbl"
inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;fill:#cecdce"
sodipodi:role="line"
id="tspan4172"
x="785.289"
y="53.929054">ILS </tspan></text>
x="807.289"
y="33.929054">ILS </tspan></text>
<text
inkscape:label="#text7243"
id="ilsFreq"
y="53.929054"
x="888.28894"
y="33.929054"
x="910.28894"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#af0063;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="53.929054"
x="888.28894"
y="33.929054"
x="910.28894"
id="tspan4176"
sodipodi:role="line"
style="font-size:32px;line-height:125%;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#af0063;fill-opacity:1">999.99</tspan></text>
<path
style="fill:none;stroke:#cecdce;stroke-width:2.4611;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 20.951614,914.85538 v 82.41763 m 4.201291,-92.8082 -4.04,-8.83104 -4.040001,8.50433 L 12,914.85538 h 8.951614 l 8.467743,0.21255 z"
id="vorLSym"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc"
inkscape:label="#path3100"
inkscape:transform-center-y="-498.20098"
inkscape:transform-center-x="-0.080644898" /><path
style="fill:none;stroke:#cecdce;stroke-width:2.38918;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 997.8036,974.07643 V 919.81909 H 987.5 l 17.7357,-42.20198 m 7.1787,96.45932 v -54.25734 h 10.557 l -17.7357,-42.20198"
style="display:inline;fill:none;stroke:#cecdce;stroke-width:3.28819;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 1006.4144,954.86998 v -26.25734 h 10.557 l -17.7357,-26.20198 m -7.4321,52.45932 V 928.61264 H 981.5 l 17.7357,-26.20198 v -6.00909"
id="vorRSym"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc"
@ -1224,14 +1311,14 @@
inkscape:transform-center-y="-715.12894" /><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="926.04407"
y="54.099972"
x="948.04407"
y="34.099972"
id="wpActiveCrs"
inkscape:label="#text7243"><tspan
sodipodi:role="line"
id="tspan4501"
x="926.04407"
y="54.099972"
x="948.04407"
y="34.099972"
style="font-size:36px;line-height:1.25">360</tspan></text>
<g
id="chrono_box"
@ -1302,7 +1389,83 @@
x="13.282043"
y="739.28204"
style="font-size:40px;line-height:1.25">OFST</tspan></text>
</g><g
<text
inkscape:label="#text7243"
id="hdgBug2ValL"
y="174.13467"
x="-97.01178"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
xml:space="preserve"
transform="rotate(-35)"><tspan
y="174.13467"
x="-97.01178"
id="tspan744"
sodipodi:role="line"
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text><text
inkscape:label="#text7243"
id="hdgBug2ValR"
y="-418.00525"
x="872.1673"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
xml:space="preserve"
transform="rotate(35)"><tspan
y="-418.00525"
x="872.1673"
id="tspan748"
sodipodi:role="line"
style="font-size:36px;line-height:1.25;fill:#179ab7;fill-opacity:1">999</tspan></text><path
id="vorLSym"
style="display:inline;fill:none;stroke:#cecdce;stroke-width:3.28819;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 23.634,896.5254 v 7.83228 m 1.26e-4,24.4977 v 24.41763 M 23.634,903.63377 8.682512,928.85538 H 23.634 l 14.467869,0.21255 z"
sodipodi:nodetypes="ccccccccc" /><g
id="dmeLDist"
transform="translate(2)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="56.791557"
y="993.85461"
id="dmeLDist1"
inkscape:label="#text7243"><tspan
style="font-size:32px;line-height:1.25;text-align:end;text-anchor:end;fill:#0dc04b"
sodipodi:role="line"
id="tspan3068"
x="56.791557"
y="993.85461">999</tspan></text><text
inkscape:label="#text7243"
id="dmeLDist2"
y="993.85461"
x="55.73262"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="993.85461"
x="55.73262"
id="tspan1329"
sodipodi:role="line"
style="font-size:24px;line-height:1.25;fill:#0dc04b">.9</tspan></text></g><g
id="dmeRDist"
transform="translate(-0.90081787)"><text
inkscape:label="#text7243"
id="dmeRDist1"
y="993.85461"
x="936.79144"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="993.85461"
x="936.79144"
id="tspan3084"
sodipodi:role="line"
style="font-size:32px;line-height:1.25;text-align:end;text-anchor:end;fill:#0dc04b">999</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="935.7326"
y="993.85461"
id="dmeRDist2"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25;fill:#0dc04b"
sodipodi:role="line"
id="tspan1346"
x="935.7326"
y="993.85461">.9</tspan></text></g></g><g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="CTR"
@ -1368,20 +1531,22 @@
id="vorCrsPtr2"
inkscape:label="#g3266"
inkscape:transform-center-y="5.4559828"
transform="matrix(0.73371425,0,0,1.2956425,136.34805,-201.98371)"><path
transform="matrix(0.73371425,0,0,1.2956425,136.34805,-201.98371)"
style="stroke-width:0.999997;stroke-miterlimit:4;stroke-dasharray:none"><path
inkscape:connector-curvature="0"
d="m 519.27414,698 h -14.54828 v 194.49655 l 7.27414,1.9e-4 7.27414,-1.9e-4 z M 504.72586,432 v -23.89752 l -38.65179,-0.001 V 402 h 38.65179 V 225.04414 l 7.61514,-0.48629 6.93314,0.4863 V 402 h 38.65179 v 6.10148 l -38.65179,0.001 V 432 Z"
style="fill:#009fd6;stroke:#009fd6;stroke-width:1.02564;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
style="fill:#009fd6;stroke:#009fd6;stroke-width:0.999997;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="vorCrsPtr2_line"
sodipodi:nodetypes="cccccccccccccccccccc" /><g
id="locPtr2"><path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;overflow:visible;visibility:visible;fill:#009fd6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.02564;marker:none;enable-background:accumulate"
id="locPtr2"
style="stroke-width:0.999997;stroke-miterlimit:4;stroke-dasharray:none"><path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;overflow:visible;visibility:visible;fill:#009fd6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.999997;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"
d="m 521.98396,447.79054 -17.26114,3.07727 0.01,235.98519 14.53528,0.01 -0.01,-235.98419 z"
id="locPtr2_line"
inkscape:connector-curvature="0"
inkscape:label="#locPtr"
sodipodi:nodetypes="cccccc" /><path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;overflow:visible;visibility:visible;fill:#009fd6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.02564;marker:none;enable-background:accumulate"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;overflow:visible;visibility:visible;fill:#009fd6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.999997;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate"
d="m 511.04486,437.35427 9.61501,5.69001 -35.22401,17.6614 -9.61501,-5.69001 c 0,0 29.42519,-14.6957 35.22387,-17.66133 5.79867,-2.96563 1.4e-4,-7e-5 1.4e-4,-7e-5 z"
id="locPtr2_arr2"
inkscape:connector-curvature="0"
@ -1392,14 +1557,14 @@
inkscape:connector-curvature="0"
id="locPtr2_arr1"
d="m 512.69442,437.35427 -9.615,5.69 35.22401,17.6614 9.615,-5.69 c 0,0 -29.42519,-14.6957 -35.22387,-17.66133 -5.79867,-2.96563 -1.4e-4,-7e-5 -1.4e-4,-7e-5 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;overflow:visible;visibility:visible;fill:#009fd6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.02564;marker:none;enable-background:accumulate" /></g><circle
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;baseline-shift:baseline;text-anchor:start;overflow:visible;visibility:visible;fill:#009fd6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.999997;stroke-miterlimit:4;stroke-dasharray:none;marker:none;enable-background:accumulate" /></g><circle
transform="matrix(0.968853,0.690717,-0.690717,0.968853,437.361,-328.129)"
id="path3951"
style="fill:none;stroke:#ededed;stroke-width:4.20218;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="fill:none;stroke:#ededed;stroke-width:0.840432;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
cx="380.07001"
cy="643.92999"
r="6.7175102" /><circle
style="fill:none;stroke:#ededed;stroke-width:4.20218;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="fill:none;stroke:#ededed;stroke-width:0.840432;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path3953"
transform="matrix(0.968853,0.690717,-0.690717,0.968853,512.923,-328.129)"
cx="380.07001"
@ -1407,11 +1572,11 @@
r="6.7175102" /><circle
transform="matrix(0.968853,0.690717,-0.690717,0.968853,663.814,-328.129)"
id="path3955"
style="fill:none;stroke:#ededed;stroke-width:4.20218;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="fill:none;stroke:#ededed;stroke-width:0.840432;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
cx="380.07001"
cy="643.92999"
r="6.7175102" /><circle
style="fill:none;stroke:#ededed;stroke-width:4.20218;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="fill:none;stroke:#ededed;stroke-width:0.840432;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path3959"
transform="matrix(0.968853,0.690717,-0.690717,0.968853,739.667,-328.128)"
cx="380.07001"
@ -1643,12 +1808,12 @@
inkscape:transform-center-y="-363.559" /><text
inkscape:label="#text7243"
id="crsLbl"
y="90.379868"
x="812.72168"
y="70.379868"
x="834.72168"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#cecdce;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="90.379868"
x="812.72168"
y="70.379868"
x="834.72168"
id="tspan4007"
sodipodi:role="line"
style="font-size:36px;line-height:1.25">CRS</tspan></text>
@ -1656,23 +1821,23 @@
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none"
x="854.72168"
y="124.87983"
y="104.87983"
id="dmeLbl"
inkscape:label="#text7243"><tspan
style="font-size:24px;line-height:1.25"
sodipodi:role="line"
id="tspan4011"
x="854.72168"
y="124.87983"> </tspan></text>
y="104.87983"> </tspan></text>
<text
inkscape:label="#text7243"
id="crs"
y="90.062439"
x="913.95801"
y="70.062439"
x="935.95801"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#179ab7;fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
y="90.062439"
x="913.95801"
y="70.062439"
x="935.95801"
id="tspan4046"
sodipodi:role="line"
style="font-size:36px;line-height:1.25">999</tspan></text>
@ -1680,13 +1845,13 @@
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ededed;fill-opacity:1;stroke:none"
x="913.95801"
y="126.12444"
y="106.12444"
id="dme"
inkscape:label="#text7243"><tspan
sodipodi:role="line"
id="tspan4071"
x="913.95801"
y="126.12444"
y="106.12444"
style="font-size:36px;line-height:1.25">99.9</tspan></text>
<g
id="gsGroup"
@ -2003,7 +2168,7 @@
id="layer9"
inkscape:label="ND_BOTTOM_MEMO"
style="display:inline"><rect
style="opacity:0.99;fill:none;stroke:#ffffff;stroke-width:3.15553"
style="opacity:0.99;fill:none;stroke:#ffffff;stroke-width:3.15591;stroke-miterlimit:4;stroke-dasharray:none"
id="nd_warn_msgbox"
width="563.05048"
height="46.844471"
@ -2105,4 +2270,15 @@
id="tspan2199"
x="510.7153"
y="399.58936"
style="font-size:53.3333px;line-height:1.25;fill:#ff0000">MAP NOT AVAIL</tspan></text></g></svg>
style="font-size:53.3333px;line-height:1.25;fill:#ff0000">MAP NOT AVAIL</tspan></text></g><text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:53.3333px;line-height:0%;font-family:'Liberation Sans';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#0dc04b;fill-opacity:1;stroke:none"
x="510.7153"
y="537.58936"
id="nd_msg_change"
inkscape:label="#text3401"><tspan
sodipodi:role="line"
id="tspan3544"
x="510.7153"
y="537.58936"
style="font-size:53.3333px;line-height:1.25;fill:#0dc04b">RANGE CHANGE</tspan></text></svg>

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View file

@ -10,6 +10,17 @@ var NOTHING = func nil;
var att_switch = props.globals.getNode("/controls/navigation/switching/att-hdg", 1);
var adirs_3 = props.globals.getNode("/instrumentation/efis[0]/nd/ir-3", 1);
var vhdg_bug = props.globals.getNode("/it-autoflight/input/hdg",0); # ND compass position deg
var terrain_minalt = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/min-altitude", 0);
var terrain_maxalt = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-altitude", -9999);
var terrain_maxcol = props.globals.getNode("/instrumentation/efis[0]/nd/terrain-on-nd/max-color", 0);
var terrain_alert = props.globals.getNode("/instrumentation/mk-viii/outputs/alert-mode",0);
var GREEN = [0.0509,0.7529,0.2941];
var YELLOW = [0.949,0.949,0.207];
var RED = [1.0000,0.0000,0.0000];
canvas.NDStyles["Airbus"] = {
font_mapper: func(family, weight) {
if( family == "Liberation Sans" and weight == "normal" )
@ -69,7 +80,7 @@ canvas.NDStyles["Airbus"] = {
level_off_alt: "/autopilot/route-manager/vnav/level-off-alt",
athr: "/it-autoflight/output/athr",
app_mode: "/instrumentation/nd/app-mode",
chrono_node: "/instrumentation/chrono",
chrono_node: "/instrumentation/ndchrono",
fpln_offset: "/autopilot/route-manager/offset",
active_route_color: [0.0509,0.7529,0.2941],
inactive_route_color: [0.95,0.95,0.21]
@ -81,15 +92,36 @@ canvas.NDStyles["Airbus"] = {
}
},
layers: [
{
name:"TERRAIN",
isMapStructure: 1,
update_on:[ {rate_hz: 10}, "toggle_range","toggle_display_mode","toggle_terrain"],
predicate: func(nd, layer) {
#print("TERRAIN TOGGLE: " ~ nd.get_switch("toggle_terrain"));
var visible = nd.get_switch("toggle_terrain") and
nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting));
if (visible) {
layer.update();
} else {
layer.display_changed = 1;
}
layer.group.setVisible(visible);
}, # end of layer update predicate
options: {
viewport_radius: 670, #512, #706,
},
"z-index": -100,
},
{
name:"WXR_live",
isMapStructure:1,
always_update: 1,
update_on:[ "toggle_range","toggle_weather","toggle_display_mode","toggle_weather_live"],
update_on:[ "toggle_range","toggle_weather","toggle_display_mode","toggle_weather_live","toggle_terrain"],
predicate: func(nd, layer) {
var visible=nd.get_switch("toggle_weather") and
nd.get_switch("toggle_weather_live") and
nd.get_switch("toggle_display_mode") != "PLAN" and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting));
nd.get_switch("toggle_display_mode") != "PLAN" and !nd.get_switch("toggle_terrain") and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting));
layer.group.setVisible(visible);
if (visible) {
layer.update();
@ -884,6 +916,44 @@ canvas.NDStyles["Airbus"] = {
is_false: NOTHING,
},
},
{
id:"hdgBug2ValR", #"hdgBug2ValL"",
impl: {
init: func(nd,symbol),
predicate: func(nd) nd.in_mode("toggle_display_mode", ["MAP"]) and !nd.get_switch("toggle_centered") and
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)),
is_true: func(nd) {
var bugRot = vhdg_bug.getValue();
var diffRot = (bugRot>=nd.userHdgTrk) ? (bugRot-nd.userHdgTrk) : (360+bugRot-nd.userHdgTrk);
if (diffRot<180 and diffRot>48) {
nd.symbols.hdgBug2ValR.setText(sprintf("%03d", bugRot+0.5)); #CHECKME - not sure about adding +.5 as "hdg" process
nd.symbols.hdgBug2ValR.show();
} else {
nd.symbols.hdgBug2ValR.hide();
}
},
is_false: func(nd) nd.symbols.hdgBug2ValR.hide(),
},
},
{
id:"hdgBug2ValL",
impl: {
init: func(nd,symbol),
predicate: func(nd) nd.in_mode("toggle_display_mode", ["MAP"]) and !nd.get_switch("toggle_centered") and
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)),
is_true: func(nd) {
var bugRot = vhdg_bug.getValue();
var diffRot = (bugRot>nd.userHdgTrk) ? (360+nd.userHdgTrk-bugRot) : (nd.userHdgTrk-bugRot);
if (diffRot<180 and diffRot>48) {
nd.symbols.hdgBug2ValL.setText(sprintf("%03d", bugRot-0.5)); #CHECKME - not sure about adding +.5 as "hdg" process
nd.symbols.hdgBug2ValL.show();
} else {
nd.symbols.hdgBug2ValL.hide();
}
},
is_false: func(nd) nd.symbols.hdgBug2ValL.hide(),
},
},
{
id:"hdgGroup",
impl: {
@ -1227,9 +1297,9 @@ canvas.NDStyles["Airbus"] = {
impl: {
init: func(nd,symbol),
predicate: func(nd){
nd.get_switch("toggle_display_mode") == "MAP" and
!nd.get_switch("toggle_centered") and
(
nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")
and (nd.change_phase != 1)
and (
getprop(nd.options.defaults.lat_ctrl) != nd.options.defaults.managed_val or
nd.get_switch("toggle_trk_line")
)
@ -1245,6 +1315,7 @@ canvas.NDStyles["Airbus"] = {
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and nd.get_switch("toggle_centered")
and (nd.change_phase != 1)
and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
is_true: func(nd) {
nd.symbols.trkInd2.show();
@ -1258,7 +1329,7 @@ canvas.NDStyles["Airbus"] = {
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and
nd.get_switch("toggle_centered") and
nd.get_switch("toggle_centered") and (nd.change_phase != 1) and
getprop(nd.options.defaults.lat_ctrl) != nd.options.defaults.managed_val and
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
is_true: func(nd) {
@ -1271,7 +1342,7 @@ canvas.NDStyles["Airbus"] = {
id:"vorCrsPtr",
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR"]) and !nd.get_switch("toggle_centered")),
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR"]) and !nd.get_switch("toggle_centered")) and (nd.change_phase != 1),
is_true: func(nd) {
nd.symbols.vorCrsPtr.show();
if (is_ils) {
@ -1288,7 +1359,7 @@ canvas.NDStyles["Airbus"] = {
id:"vorCrsPtr2",
impl: {
init: func(nd,symbol),
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR"]) and nd.get_switch("toggle_centered")),
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR"]) and nd.get_switch("toggle_centered")) and (nd.change_phase != 1),
is_true: func(nd) {
nd.symbols.vorCrsPtr2.show();
var is_ils = (nd.get_switch("toggle_display_mode") == "APP");
@ -1315,7 +1386,7 @@ canvas.NDStyles["Airbus"] = {
id: "gsDiamond",
impl: {
init: func(nd,symbol),
predicate: func(nd) nd.in_mode("toggle_display_mode", ["APP"]),
predicate: func(nd) nd.in_mode("toggle_display_mode", ["APP"]) and (nd.change_phase != 1),
is_true: func(nd) {
if(getprop("/instrumentation/nav/gs-needle-deflection-norm") != nil)
nd.symbols.gsDiamond.setTranslation(getprop("/instrumentation/nav[0]/gs-needle-deflection-norm")*150,0);
@ -1383,7 +1454,7 @@ canvas.NDStyles["Airbus"] = {
var ils_mode = getprop("/Flight-management/freq/ils-mode");
var has_ils = (nav_id != nil and nav_id != "");
(nd.get_switch("toggle_display_mode") == "MAP" and
!nd.get_switch("toggle_centered") and has_ils and ils_mode);
!nd.get_switch("toggle_centered") and has_ils and ils_mode and (nd.change_phase != 1));
},
is_true: func(nd) {
nd.symbols.locTrkPointer.show();
@ -1403,7 +1474,7 @@ canvas.NDStyles["Airbus"] = {
var ils_mode = getprop("/Flight-management/freq/ils-mode");
var has_ils = (nav_id != nil and nav_id != "");
(nd.get_switch("toggle_display_mode") == "MAP" and
nd.get_switch("toggle_centered") and has_ils and ils_mode);
nd.get_switch("toggle_centered") and has_ils and ils_mode and (nd.change_phase != 1));
},
is_true: func(nd) {
nd.symbols.locTrkPointer2.show();
@ -1563,15 +1634,15 @@ canvas.NDStyles["Airbus"] = {
nd.symbols.vorL.setText("ADF 1");
nd.symbols.vorL.setColor(0.195,0.96,0.097);
nd.symbols.vorLId.setColor(0.195,0.96,0.097);
nd.symbols.dmeLDist.setColor(0.195,0.96,0.097);
}
else{
#nd.symbols.dmeLDist.setColor(0.195,0.96,0.097);
nd.symbols.dmeL.setText("");
} else {
nd.symbols.vorL.setText("VOR 1");
nd.symbols.vorL.setColor(1,1,1);
nd.symbols.vorLId.setColor(1,1,1);
nd.symbols.dmeLDist.setColor(1,1,1);
}
#nd.symbols.dmeLDist.setColor(1,1,1);
nd.symbols.dmeL.setText("NM");
}
nd.symbols.dmeL.setColor(0,0.59,0.8);
},
is_false: func(nd){
@ -1590,14 +1661,14 @@ canvas.NDStyles["Airbus"] = {
nd.symbols.vorR.setText("ADF 2");
nd.symbols.vorR.setColor(0.195,0.96,0.097);
nd.symbols.vorRId.setColor(0.195,0.96,0.097);
nd.symbols.dmeRDist.setColor(0.195,0.96,0.097);
nd.symbols.dmeR.setText("");
} else {
nd.symbols.vorR.setText("VOR 2");
nd.symbols.vorR.setColor(1,1,1);
nd.symbols.vorRId.setColor(1,1,1);
nd.symbols.dmeRDist.setColor(1,1,1);
}
#nd.symbols.dmeRDist.setColor(1,1,1);
nd.symbols.dmeR.setText("NM");
}
nd.symbols.dmeR.setColor(0,0.59,0.8);
},
is_false: func(nd){
@ -1653,6 +1724,8 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_lh_vor_adf") != 0),
is_true: func(nd) {
if (nd.get_switch("toggle_lh_vor_adf") < 0) nd.symbols.vorLSym.setColor(0.195,0.96,0.097);
else nd.symbols.vorLSym.setColor(1,1,1);
nd.symbols.vorLSym.show();
},
is_false: func(nd){
@ -1708,6 +1781,8 @@ canvas.NDStyles["Airbus"] = {
init: func(nd,symbol),
predicate: func(nd) (nd.get_switch("toggle_rh_vor_adf") != 0),
is_true: func(nd) {
if (nd.get_switch("toggle_rh_vor_adf") < 0) nd.symbols.vorRSym.setColor(0.195,0.96,0.097);
else nd.symbols.vorRSym.setColor(1,1,1);
nd.symbols.vorRSym.show();
},
is_false: func(nd){
@ -1919,6 +1994,53 @@ canvas.NDStyles["Airbus"] = {
nd.symbols.offsetLbl.hide();
}
}
},
{
id: "terrGroup",
impl: {
init: func(nd,symbol),
predicate: func(nd) ( nd.get_switch("toggle_terrain") and
nd.get_switch("toggle_display_mode") != "PLAN" and (nd.rangeNm() <= 40) and
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) ),
is_true: func(nd){
if (terrain_maxalt.getValue() != -9999) {
var alert = terrain_alert.getValue();
if (alert == 0) {
nd.symbols.TerrLabel.setVisible(1);
nd.symbols.terrAhead.setVisible(0);
} else {
nd.symbols.TerrLabel.setVisible(0);
nd.symbols.terrAhead.setVisible(1);
if (alert == 1) nd.symbols.terrAhead.setColor(YELLOW[0],YELLOW[1],YELLOW[2]);
else nd.symbols.terrAhead.setColor(RED[0],RED[1],RED[2]);
}
nd.symbols.terrLO.setText(sprintf("%03d",math.round(terrain_minalt.getValue()/100)));
nd.symbols.terrHI.setText(sprintf("%03d",math.round(terrain_maxalt.getValue()/100)));
if (terrain_maxcol.getValue() == 0) nd.symbols.terrHI.setColor(GREEN[0],GREEN[1],GREEN[2]);
else if (terrain_maxcol.getValue() == 1) nd.symbols.terrHI.setColor(YELLOW[0],YELLOW[1],YELLOW[2]);
else nd.symbols.terrHI.setColor(RED[0],RED[1],RED[2]);
nd.symbols.terrGroup.show();
terrain_maxalt.setValue(-9999); #update visual at radar cycle
}
},
is_false: func(nd){
nd.symbols.terrGroup.hide();
}
}
},
{
id: "nd_msg_change",
impl: {
init: func(nd, symbol),
predicate: func(nd) ( (nd.change_phase != 0) and
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting)) ),
is_true: func(nd) {
nd.symbols.nd_msg_change.show();
},
is_false: func(nd) {
nd.symbols.nd_msg_change.hide();
}
}
}
], # end of vector with features

View file

@ -1698,6 +1698,41 @@
<command>property-toggle</command>
<property>instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit</property>
</binding>
<binding>
<condition>
<equals>
<property>instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit</property>
<value>1</value>
</equals>
</condition>
<command>property-assign</command>
<property>instrumentation/efis/inputs/terr</property>
<value>0</value>
</binding>
<binding>
<condition>
<equals>
<property>instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit</property>
<value>1</value>
</equals>
</condition>
<command>property-assign</command>
<property>instrumentation/efis[1]/inputs/terr</property>
<value>0</value>
</binding>
<binding>
<condition>
<equals>
<property>instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit</property>
<value>0</value>
</equals>
</condition>
<command>nasal</command>
<script>
setprop("instrumentation/efis/inputs/terr",getprop("controls/switches/terr_on_nd_l"));
setprop("instrumentation/efis[1]/inputs/terr",getprop("controls/switches/terr_on_nd_r"));
</script>
</binding>
<binding>
<command>nasal</command>
<script>libraries.pushbutton();</script>

View file

@ -0,0 +1,41 @@
# Projection-related helper functions for the MFD maps
var Camera = {
new: func(options) {
var m = {
parents: [Camera],
camGeo: options['camGeo'] or geo.aircraft_position(),
camHdg: options['camHdg'] or 0,
range: options['range'] or 10.0,
screenRange: options['screenRange'] or 256.0,
screenCX: options['screenCX'] or options['screenRange'] or 256.0,
screenCY: options['screenCY'] or options['screenRange'] or 256.0,
};
return m;
},
setRange: func(range) {
me.range = range;
},
repositon: func(geo, hdg) {
me.camGeo = geo;
me.camHdg = hdg;
},
project: func(targetGeo) {
var dist = me.camGeo.distance_to(targetGeo) * M2NM;
var bearing = me.camGeo.course_to(targetGeo) - me.camHdg;
return me.projectDistBearing(dist, bearing);
},
projectDistBearing: func(dist, bearing) {
var bearingRad = bearing * D2R;
var tx = math.sin(bearingRad) * dist;
var ty = -math.cos(bearingRad) * dist;
var x = tx * me.screenRange / me.range + me.screenCX;
var y = ty * me.screenRange / me.range + me.screenCY;
return [x, y];
},
};

358
Nasal/Displays/traffic.nas Normal file
View file

@ -0,0 +1,358 @@
# Traffic layer
var ATCSwitchAbvBlw = props.globals.getNode("/controls/atc/abv-blw");
var ATCSwitchThrtAll = props.globals.getNode("/controls/atc/thrt-all");
var colorByLevel = {
# 0: other
0: [0.8,0.8,0.8],
# 1: proximity
1: [0.8,0.8,0.8],
# 2: traffic advisory (TA)
2: [1,0.75,0],
# 3: resolution advisory (RA)
3: [1,0,0],
};
var doFill = {
0: 0,
1: 1,
2: 1,
3: 1,
};
var colorDefault = [0.8,0.8,0.8];
var drawBlip = func(elem, threatLvl) {
if (threatLvl == 3) {
# resolution advisory
elem.reset()
.setStrokeLineWidth(0)
.moveTo(-17,-17)
.horiz(34)
.vert(34)
.horiz(-34)
.close();
}
elsif (threatLvl == 2) {
# traffic advisory
elem.reset()
.moveTo(-17,0)
.setStrokeLineWidth(0)
.arcSmallCW(17,17,0,34,0)
.arcSmallCW(17,17,0,-34,0);
}
elsif (threatLvl == 1) {
# proximate traffic
elem.reset()
.setStrokeLineWidth(0)
.moveTo(-14,0)
.lineTo(0,-17)
.lineTo(14,0)
.lineTo(0,17)
.close();
}
else {
# other traffic
elem.reset()
.setStrokeLineWidth(4)
.moveTo(-10,0)
.lineTo(0,-14)
.lineTo(10,0)
.lineTo(0,14)
.lineTo(-10,0);
}
};
var TrafficLayer = {
new: func(camera, group) {
var m = {
parents: [TrafficLayer],
camera: camera,
refAlt: 0,
group: group,
items: {},
sorted: {}, # TODO - only the most 8 relevant advisories
values: {},
updateKeys: [],
addListener: nil,
delListener: nil,
};
return m;
},
makeElems: func () {
if (me.group == nil) return nil;
var elems = {};
elems['master'] = me.group.createChild('group');
elems['blip'] = elems.master.createChild('path')
.setStrokeLineWidth(0);
elems['text'] = elems.master.createChild('text')
.setDrawMode(canvas.Text.TEXT)
.setText(sprintf("0"))
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
.setColor(1,1,1)
.setFontSize(32)
.setAlignment("center-center");
elems['master'].hide();
elems['arrowUp'] = elems.master.createChild("text")
.setDrawMode(canvas.Text.TEXT)
.setText(sprintf("↑"))
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
.setColor(1,1,1)
.setFontSize(50)
.setTranslation(16, 2)
.setAlignment("left-center");
elems['arrowDown'] = elems.master.createChild("text")
.setDrawMode(canvas.Text.TEXT)
.setText(sprintf("↓"))
.setFont("LiberationFonts/LiberationSans-Regular.ttf")
.setColor(1,1,1)
.setFontSize(50)
.setTranslation(16, 2)
.setAlignment("left-center");
return elems;
},
start: func() {
me.stop();
var self = me;
me.addListener = setlistener('/ai/models/model-added', func(changed, listen, mode, is_child) {
var path = changed.getValue();
if (path == nil) return;
#printf("ADD: %s", path);
me.values[path] = nil;
var masterProp = props.globals.getNode(path);
var prop = {
'master': masterProp,
};
if (me.items[path] == nil) {
me.items[path] = {
prop: prop,
elems: me.makeElems(),
data: {'threatLevel': -2},
};
}
else {
me.items[path].prop = prop;
me.items[path].data = {'threatLevel': -2};
}
}, 1, 1);
me.delListener = setlistener('/ai/models/model-removed', func(changed, listen, mode, is_child) {
var path = changed.getValue();
if (path == nil) return;
#printf("DEL: %s", path);
me.values[path] = nil;
if (me.items[path] == nil) return;
if (me.items[path] != nil) {
me.items[path].prop = nil;
me.items[path].elems.master.hide();
me.items[path].data = {};
}
}, 1, 1);
},
stop: func() {
if (me.addListener != nil) {
removelistener(me.addListener);
me.addListener = nil;
}
if (me.delListener != nil) {
removelistener(me.delListener);
me.delListener = nil;
}
me.items = {};
if (me.group != nil) {
me.group.removeAllChildren();
}
},
nxtupdatetime: 0,
update: func() {
var _tm = systime();
if (me.nxtupdatetime != 0) {
if (_tm<me.nxtupdatetime) return;
}
me.nxtupdatetime = _tm + 0.5; # refresh rate at 500ms
if (size(me.updateKeys) == 0) {
me.updateKeys = keys(me.items);
}
var path = pop(me.updateKeys);
foreach (var path; keys(me.items)) {
me.updateItem(path);
}
},
redraw: func() {
foreach (var path; keys(me.items)) {
me.redrawItem(me.items[path],me.values[path]);
}
},
setRefAlt: func(alt) {
me.refAlt = alt;
},
proplist: ['lat', 'lon', 'alt', 'threatLevel', 'callsign', 'vspeed', 'tas'],
updateItem: func(path) {
var item = me.items[path];
if (item == nil) return;
if (item.prop == nil) {
if (item.elems != nil) {
item.elems.master.hide();
}
return;
}
if (item.prop['lat'] == nil) {
item.prop['lat'] = item.prop.master.getNode('position/latitude-deg');
item.prop['lon'] = item.prop.master.getNode('position/longitude-deg');
item.prop['alt'] = item.prop.master.getNode('position/altitude-ft');
}
if (item.prop['threatLevel'] == nil) {
item.prop['threatLevel'] = item.prop.master.getNode('tcas/threat-level');
}
if (item.prop['callsign'] == nil) {
item.prop['callsign'] = item.prop.master.getNode('callsign');
}
if (item.prop['vspeed'] == nil) {
item.prop['vspeed'] = item.prop.master.getNode('velocities/vertical-speed-fps');
item.prop['tas'] = item.prop.master.getNode('velocities/true-airspeed-kt');
}
# this item has a prop associated with it
if (item.elems == nil) {
item.elems = me.makeElems();
}
var oldThreatLevel = item.data['threatLevel'];
foreach (var k; me.proplist) {
if (item.prop[k] != nil) {
item.data[k] = item.prop[k].getValue();
}
}
if (item.data['threatLevel'] == -1) { # airplane with TCAS not enabled or supported
me.values[path] = {visible: 0};
return;
}
if (oldThreatLevel != item.data['threatLevel']) {
item.data['threatLevelDirty'] = 1;
}
var newThrtAll = ATCSwitchThrtAll.getValue();
if (newThrtAll == 1) { # AUTO - display only proximate and higher advisories
if (item.data['threatLevel']==0) {
me.values[path] = {visible: 0};
return;
}
}
var _lat = item.data['lat'];
var _lon = item.data['lon'];
var alt = item.data['alt'];
var vspeed = item.data['vspeed'];
var tas = item.data['tas'];
me.values[path] = nil;
if (_lat != nil and _lon != nil and vspeed != nil) {
if (tas<80) { # flying airplane only
me.values[path] = {visible: 0};
return;
}
var top = 27;
var bottom = -27;
if (ATCSwitchAbvBlw.getValue() == -1) {
top = 99;
}
if (ATCSwitchAbvBlw.getValue() == 1) {
bottom = -99;
}
var altDiff100 = ((alt or me.refAlt) - me.refAlt) / 100;
if (altDiff100 > top or altDiff100 < bottom) { # check TCAS vertical range
me.values[path] = {visible: 0};
return;
}
var _val = {visible:1, lat:_lat, lon:_lon, dirty:item.data['threatLevelDirty']};
var spd = vspeed * 60;
_val.arrowup = (spd > 500);
_val.arrowdown = (spd < -500);
if (math.abs(altDiff100) > 0.5) {
_val.text = sprintf("%+03.0f ", altDiff100);
} else {
_val.text = "";
}
_val.textpy = (altDiff100 < 0) ? 34 : -30;
me.values[path] = _val;
}
},
redrawItem: func (item,val) {
#debug.dump("REDRAW ", item.data);
if (val != nil and val.visible == 1) {
var lat = val.lat;
var lon = val.lon;
var coords = geo.Coord.new();
coords.set_latlon(lat, lon);
var (x, y) = me.camera.project(coords);
item.elems.master.setTranslation(x, y);
#printf("%f %f", x, y);
if (val.dirty) {
#printf('%s THREAT LVL: %i', item.data['callsign'] or '???', item.data['threatLevel']);
var threatLevel = item.data['threatLevel'];
#debug.dump(item.data, threatLevel);
drawBlip(item.elems.blip, threatLevel);
var rgb = colorByLevel[threatLevel];
if (rgb == nil) rgb = colorDefault;
var color = canvas._getColor(rgb);
var (r, g, b) = rgb;
if (threatLevel > 0) {
item.elems.blip.setColorFill(r, g, b);
} else {
item.elems.blip.setColor(r, g, b);
}
item.elems.text.setColor(r, g, b);
item.elems.arrowUp.setColor(r, g, b);
item.elems.arrowDown.setColor(r, g, b);
item.elems.master.set('z-index', threatLevel + 2);
item.data['threatLevelDirty'] = 0;
val.dirty = 0;
}
item.elems.arrowUp.setVisible(val.arrowup);
item.elems.arrowDown.setVisible(val.arrowdown);
item.elems.text.setText(val.text);
item.elems.text.setTranslation(0, val.textpy);
item.elems.master.show();
} else {
item.elems.master.hide();
}
},
};

View file

@ -12,7 +12,6 @@ var leftOverflow = props.globals.initNode("/ECAM/warnings/overflow-left", 0, "B
var rightOverflow = props.globals.initNode("/ECAM/warnings/overflow-right", 0, "BOOL");
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"), props.globals.initNode("/sim/sound/warnings/cricket", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/retard", 0, "BOOL"), props.globals.initNode("/sim/sound/warnings/cchord", 0, "BOOL")];
@ -76,6 +75,33 @@ var warningNodes = {
greenYellowFuel: props.globals.initNode("/ECAM/warnings/hyd/green-yellow-fuel-consumpt"),
leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault"),
rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault"),
flapNotZero: props.globals.initNode("/ECAM/warnings/fctl/flaps-not-zero"),
slatsConfig: props.globals.initNode("/ECAM/warnings/fctl/slats-config-output"),
flapsConfig: props.globals.initNode("/ECAM/warnings/fctl/flaps-config-output"),
spdBrkConfig: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-config-output"),
pitchTrimConfig: props.globals.initNode("/ECAM/warnings/fctl/pitch-trim-config-output"),
rudTrimConfig: props.globals.initNode("/ECAM/warnings/fctl/rudder-trim-config-output"),
parkBrkConfig: props.globals.initNode("/ECAM/warnings/fctl/park-brk-config-output"),
slatsConfig2: props.globals.initNode("/ECAM/warnings/fctl/slats-config-range"),
flapsConfig2: props.globals.initNode("/ECAM/warnings/fctl/flaps-config-range"),
spdBrkConfig2: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-config-range"),
pitchTrimConfig2: props.globals.initNode("/ECAM/warnings/fctl/pitch-trim-config-range"),
rudTrimConfig2: props.globals.initNode("/ECAM/warnings/fctl/rudder-trim-config-range"),
dcEssFuelConsumptionIncreased: props.globals.initNode("/ECAM/warnings/logic/dc-ess-fuel-consumption-increased"),
dcEssFMSPredictions: props.globals.initNode("/ECAM/warnings/logic/dc-ess-fms-predictions-unreliable"),
dc2FuelConsumptionIncreased: props.globals.initNode("/ECAM/warnings/logic/dc-2-fuel-consumption-increased"),
dc2FMSPredictions: props.globals.initNode("/ECAM/warnings/logic/dc-2-fms-predictions-unreliable"),
thrLeversNotSet: props.globals.initNode("/ECAM/warnings/logic/eng/thr-lever-not-set"),
revSet: props.globals.initNode("/ECAM/warnings/logic/eng/reverse-set"),
eng1Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-fail"),
eng2Fail: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-fail"),
phase5Trans: props.globals.initNode("/ECAM/warnings/logic/eng/phase-5-output"),
eng1Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-1-shutdown"),
eng2Shutdown: props.globals.initNode("/ECAM/warnings/logic/eng/eng-2-shutdown"),
acEssBusAltn: props.globals.initNode("/ECAM/warnings/logic/ac-ess-bus-altn-feed"),
gen1Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-1-off"),
gen2Off: props.globals.initNode("/ECAM/warnings/logic/elec/gen-2-off"),
spdBrkOut: props.globals.initNode("/ECAM/warnings/fctl/spd-brk-still-out"),
},
Timers: {
apuFaultOutput: props.globals.initNode("/ECAM/warnings/timer/apu-fault-output"),
@ -110,6 +136,20 @@ var warningNodes = {
navTerrFault: props.globals.initNode("/ECAM/warnings/timer/nav-gpws-terr-fault"),
leftElevFail: props.globals.initNode("/ECAM/warnings/fctl/leftElevFault-output"),
rightElevFail: props.globals.initNode("/ECAM/warnings/fctl/rightElevFault-output"),
staticInverter: props.globals.initNode("/systems/electrical/some-electric-thingie/static-inverter-timer"),
dcEmerConfig: props.globals.initNode("/ECAM/warnings/logic/dc-emer-config-output"),
dc12Fault: props.globals.initNode("/ECAM/warnings/logic/dc-1-2-output"),
dcEssFault: props.globals.initNode("/ECAM/warnings/logic/dc-ess-output"),
dc1Fault: props.globals.initNode("/ECAM/warnings/logic/dc-1-output"),
dc2Fault: props.globals.initNode("/ECAM/warnings/logic/dc-2-output"),
dcBatFault: props.globals.initNode("/ECAM/warnings/logic/dc-bat-output"),
ac1Fault: props.globals.initNode("/ECAM/warnings/logic/ac-1-output"),
ac2Fault: props.globals.initNode("/ECAM/warnings/logic/ac-2-output"),
acEssFault: props.globals.initNode("/ECAM/warnings/logic/ac-ess-output"),
dcEssShed: props.globals.initNode("/ECAM/warnings/logic/dc-ess-shed-output"),
acEssShed: props.globals.initNode("/ECAM/warnings/logic/ac-ess-shed-output"),
centerPumpsOff: props.globals.initNode("/ECAM/warnings/fuel/center-pumps-off-output"),
lowLevelBoth: props.globals.initNode("/ECAM/warnings/fuel/lo-level-l-r-output"),
},
Flipflops: {
apuGenFault: props.globals.initNode("/ECAM/warnings/flipflop/apu-gen-fault"),
@ -389,6 +429,7 @@ var ECAM_controller = {
m.active = 0;
}
}
me._ready = 1;
},
clear: func() {
hasCleared = 0;
@ -479,7 +520,7 @@ var ECAM_controller = {
};
setlistener("/systems/electrical/bus/dc-ess", func {
if (dc_ess.getValue() < 25) {
if (systems.ELEC.Bus.dcEss.getValue() < 25) {
ECAM_controller.reset();
}
}, 0, 0);

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@
# Left E/WD
var warnings = std.Vector.new([
# LEVEL 3 WARN
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, isMainMsg: 1),
@ -47,12 +48,12 @@ var warnings = std.Vector.new([
var eng1FireFlAgent1Timer = warning.new(msg: " -AGENT 1 AFT 10 S.DISCH", colour: "w"),
var eng1FireFlAgent1 = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng1FireFlATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng1FireFl30Sec = warning.new(msg: " •IF FIRE AFTER 30 S:", colour: "w", isMainMsg: 1),
var eng1FireFl30Sec = warning.new(msg: " •IF FIRE AFTER 30 S:", colour: "w"),
var eng1FireFlAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
# ENG 1 FIRE (ground)
var eng1FireGnlever = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"),
var eng1FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w", isMainMsg: 1),
var eng1FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w"),
var eng1FireGnparkbrk = warning.new(msg: " -PARKING BRK.........ON", colour: "c"),
var eng1FireGnATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng1FireGncrew = warning.new(msg: " -CABIN CREW.......ALERT", colour: "c"),
@ -70,12 +71,12 @@ var warnings = std.Vector.new([
var eng2FireFlAgent1Timer = warning.new(msg: " -AGENT 1 AFT 10 S.DISCH", colour: "w"),
var eng2FireFlAgent1 = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng2FireFlATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng2FireFl30Sec = warning.new(msg: " •IF FIRE AFTER 30 S:", colour: "w", isMainMsg: 1),
var eng2FireFl30Sec = warning.new(msg: " •IF FIRE AFTER 30 S:", colour: "w"),
var eng2FireFlAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
# ENG 2 FIRE (ground)
var eng2FireGnlever = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"),
var eng2FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w", isMainMsg: 1),
var eng2FireGnstopped = warning.new(msg: " •WHEN A/C IS STOPPED:", colour: "w"),
var eng2FireGnparkbrk = warning.new(msg: " -PARKING BRK.........ON", colour: "c"),
var eng2FireGnATC = warning.new(msg: " -ATC.............NOTIFY", colour: "c"),
var eng2FireGncrew = warning.new(msg: " -CABIN CREW.......ALERT", colour: "c"),
@ -85,6 +86,20 @@ var warnings = std.Vector.new([
var eng2FireGnAgent2 = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
var eng2FireGnEvac = warning.new(msg: " -EMER EVAC PROC...APPLY", colour: "c"),
# ADR 1 + 2 + 3 FAULT
var ADR123Fault = warning.new(msg: "NAV ADR1+2+3 FAULT ", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var ADR123FaultAP = warning.new(msg: " -AP+FD..............OFF", colour: "c"),
var ADR123FaultATHR = warning.new(msg: " -ATHR...............OFF", colour: "c"),
var ADR123FaultPRBW = warning.new(msg: " -PROBE/WINDOW HEAT...ON", colour: "c"),
var ADR123FaultBUSSC = warning.new(msg: " -CAPT BKUP SPD/ALT...ON", colour: "c"),
var ADR123FaultBUSSF = warning.new(msg: " -FO BKUP SPD/ALT.....ON", colour: "c"),
var ADR123FaultADRPB = warning.new(msg: " -ADR 1+2+3 P/B......OFF", colour: "c"),
var ADR123FaultSPD = warning.new(msg: " -SPD......FLY THE GREEN", colour: "c"),
var ADR123FaultAOADISAG = warning.new(msg: " •IF AOA DISAGREE: ", colour: "w"),
var ADR123FaultBUSSINOP = warning.new(msg: " BKUP SPD/ALT.DO NOT USE", colour: "c"),
var ADR123FaultSTBY = warning.new(msg: " -STBY INST.MAY BE UNREL", colour: "c"),
var ADR123FaultPROC = warning.new(msg: " -ALL ADR OFF PROC.APPLY", colour: "c"),
# APU FIRE
var apuFire = warning.new(msg: "APU FIRE ", colour: "r", aural: 0, light: 0, isMainMsg: 1, sdPage: "apu"),
var apuFirePB = warning.new(msg: " -APU FIRE P/B......PUSH", colour: "c"),
@ -105,6 +120,37 @@ var warnings = std.Vector.new([
var rud_trim_config_1 = warning.new(msg: " NOT IN T.O. RANGE", colour: "r", aural: 0, light: 0),
var park_brk_config = warning.new(msg: "CONFIG PARK BRK ON", colour: "r", aural: 0, light: 0),
# EXCESS CAB ALT
var excessCabAlt = warning.new(msg: "CAB PR EXCESS CAB ALT", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var excessCabAltMask = warning.new(msg: " -CREW OXY MASKS.....USE", colour: "c"),
var excessCabAltSigns = warning.new(msg: " -SIGNS...............ON", colour: "c"),
var excessCabAltEmerD = warning.new(msg: " •EMER DESCENT:", colour: "w"),
var excessCabAltDES = warning.new(msg: " -DESCENT.......INITIATE", colour: "c"),
var excessCabAltTHRLVR = warning.new(msg: " -THR LEVERS........IDLE", colour: "c"),
var excessCabAltSPDBRK = warning.new(msg: " -SPD BRK...........FULL", colour: "c"),
var excessCabAltSPD = warning.new(msg: " SPD.....MAX/APPROPRIATE", colour: "c"),
var excessCabAltENG = warning.new(msg: " -ENG MODE...........IGN", colour: "c"),
var excessCabAltCAB = warning.new(msg: " -CABIN CREW......ADVISE", colour: "c"),
var excessCabAltPA = warning.new(msg: " -EMER DES (PA).ANNOUNCE", colour: "c"),
var excessCabAltXPDR = warning.new(msg: " -XPDR 7700.....CONSIDER", colour: "c"),
var excessCabAltMEA = warning.new(msg: " MAX FL.....100/MEA-MORA", colour: "c"),
var excessCabAltCabAlt = warning.new(msg: " •IF CAB ALT>14000 FT:", colour: "w"),
var excessCabAltMasks = warning.new(msg: " -PAX OXY MASKS...MAN ON", colour: "c"),
# ENG 1 OIL LO PR
var eng1OilLoPr = warning.new(msg: "ENG 1 OIL LO PR ", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var eng1OilLoPrIf = warning.new(msg: " •IF OIL PR < 13 PSI :", colour: "w"),
var eng1OilLoPrIf2 = warning.new(msg: " •IF OIL PR < 60 PSI :", colour: "w"),
var eng1OilLoPrThrot = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"),
var eng1OilLoPrMaster = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"),
# ENG 2 OIL LO PR
var eng2OilLoPr = warning.new(msg: "ENG 2 OIL LO PR ", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var eng2OilLoPrIf = warning.new(msg: " •IF OIL PR < 13 PSI :", colour: "w"),
var eng2OilLoPrIf2 = warning.new(msg: " •IF OIL PR < 60 PSI :", colour: "w"),
var eng2OilLoPrThrot = warning.new(msg: " -THR LEVER 2.......IDLE", colour: "c"),
var eng2OilLoPrMaster = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"),
# FCTL L+R ELEV FAULT
var lrElevFault = warning.new(msg: "F/CTL L+R ELEV FAULT", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var lrElevFaultSpeed = warning.new(msg: " MAX SPEED.......320/.77", colour: "c"),
@ -116,8 +162,8 @@ var warnings = std.Vector.new([
var gearNotDownLocked = warning.new(msg: "L/G GEAR NOT DOWNLOCKED", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var gearNotDownLockedRec = warning.new(msg: " -L/G LEVER......RECYCLE", colour: "c"),
var gearNotDownLockedWork = warning.new(msg: " •IF UNSUCCESSFUL:", colour: "c"),
var gearNotDownLocked120 = warning.new(msg: " AFTER 120S:", colour: "c"),
var gearNotDownLockedWork = warning.new(msg: " •IF UNSUCCESSFUL:", colour: "w"),
var gearNotDownLocked120 = warning.new(msg: " AFTER 120S:", colour: "w"),
var gearNotDownLockedGrav = warning.new(msg: " -L/G.........GRVTY EXTN", colour: "c"),
# Autopilot off involuntary
@ -125,18 +171,34 @@ var warnings = std.Vector.new([
# Cargo smoke
var cargoSmokeFwd = warning.new(msg: "SMOKE FWD CARGO SMOKE", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var cargoSmokeFwdFans = warning.new(msg: " -CAB FANS...........OFF", colour: "c"),
var cargoSmokeFwdGrdClsd = warning.new(msg: " •IF FWD CRG CLSD:", colour: "w"),
var cargoSmokeFwdAgent = warning.new(msg: " -AGENT............DISCH", colour: "c"),
var cargoSmokeFwdGrd = warning.new(msg: " •WHEN ON GROUND", colour: "w"),
var cargoSmokeFwdDoors = warning.new(msg: " BEFORE OPEN CRG DOORS:", colour: "w"),
var cargoSmokeFwdDisemb = warning.new(msg: "-PAX..........DISEMBARK", colour: "c"),
var cargoSmokeAft = warning.new(msg: "SMOKE AFT CARGO SMOKE", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var cargoSmokeAftFans = warning.new(msg: " -CAB FANS...........OFF", colour: "c"),
var cargoSmokeAftGrdClsd = warning.new(msg: " •IF AFT CRG CLSD:", colour: "w"),
var cargoSmokeAftAgent = warning.new(msg: " -AGENT............DISCH", colour: "c"),
var cargoSmokeAftGrd = warning.new(msg: " •WHEN ON GROUND", colour: "w"),
var cargoSmokeAftDoors = warning.new(msg: " BEFORE OPEN CRG DOORS:", colour: "w"),
var cargoSmokeAftDisemb = warning.new(msg: "-PAX..........DISEMBARK", colour: "c"),
# Lavatory SMOKE
var lavatorySmoke = warning.new(msg: "SMOKE LAVATORY SMOKE ", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var lavatorySmokeComm = warning.new(msg: "-CKPT/CAB COM.ESTABLISH ", colour: "c"),
# EXCES RESID PR
var excessResidPress = warning.new(msg: "CAB PR EXCES RESIDUAL PR ", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var excessResidPressPack1 = warning.new(msg: "-PACK 1.............OFF", colour: "c"),
var excessResidPressPack2 = warning.new(msg: "-PACK 2.............OFF", colour: "c"),
var excessResidPressCabCr = warning.new(msg: "-CABIN CREW.......ALERT", colour: "c"),
# ESS Bus on Bat
# NEW EMER CONFIG
var essBusOnBat = warning.new(msg: "ELEC ESS BUSES ON BAT", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var essBusOnBatLGUplock = warning.new(msg: " •WHEN L/G UPLOCKED :", colour: "w"),
var essBusOnBatManOn = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"),
var essBusOnBatRetract = warning.new(msg: " •IF L/G RETRACT FAULT:", colour: "w"),
var essBusOnBatMinSpeed = warning.new(msg: " MIN RAT SPD......180 KT", colour: "c"),
var essBusOnBatLGCB = warning.new(msg: " -LGCIU1 C/B (C09)..PULL", colour: "c"),
var essBusOnBatManOn2 = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"),
var essBusOnBatMinSpeed = warning.new(msg: " MIN RAT SPD......140 KT", colour: "c"),
# Emer Config
var emerconfig = warning.new(msg: "ELEC EMER CONFIG", colour: "r", aural: 0, light: 0, isMainMsg: 1),
@ -148,13 +210,14 @@ var warnings = std.Vector.new([
var emerconfigManOn = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"),
var emerconfigEngMode = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
var emerconfigRadio = warning.new(msg: " -VHF1/ATC1..........USE", colour: "c"),
var emerconfigIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var emerconfigFuelG = warning.new(msg: " FUEL GRVTY FEED", colour: "c"),
var emerconfigFuelG2 = warning.new(msg: " PROC:GRVTY FUEL FEEDING", colour: "c"),
var emerconfigFAC = warning.new(msg: " -FAC 1......OFF THEN ON", colour: "c"),
var emerconfigBusTie2 = warning.new(msg: " -BUS TIE...........AUTO", colour: "c"),
var emerconfigAPU = warning.new(msg: " -APU (IF AVAIL)...START", colour: "c"),
var emerconfigVent = warning.new(msg: " -BLOWER + EXTRACT..OVRD", colour: "c"),
var emerconfigFuelIN = warning.new(msg: " FUEL CONSUMPT INCRSD", colour: "c"),
var emerconfigFMSPRD = warning.new(msg: " FMS PRED UNRELIABLE", colour: "c"),
# B + Y LO PR
var hydBYloPr = warning.new(msg: "HYD B+Y SYS LO PR", colour: "r", aural: 0, light: 0, isMainMsg: 1),
@ -190,15 +253,140 @@ var warnings = std.Vector.new([
var hydGYloPrFuelCnsmpt = warning.new(msg: " FUEL CONSUMPT INCRSD", colour: "c"),
var hydGYloPrFmsPredict = warning.new(msg: " FMS PRED UNRELIABLE", colour: "c"),
# AIR BLEED LEAK
var airBleedLeak = warning.new(msg: "AIR BLEED LEAK ", colour: "r", aural: 0, light: 0, isMainMsg: 1),
var airBleedLeakShut = warning.new(msg: " -X BLEED..........SHUT", colour: "c"),
# LEVEL 2 WARN
# THR LEVERS NOT SET
var engThrustLvrNotSet = warning.new(msg: "ENG THR LEVERS NOT SET ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var engThrustLvrNotSetMCT = warning.new(msg: " -THR LEVERS ....MCT/FLX", colour: "c"),
var engThrustLvrNotSetTO = warning.new(msg: " -THR LEVERS.......TO/GA", colour: "c"),
# REV SET
var engRevSet = warning.new(msg: "ENG REV SET ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var engRevSetLevers = warning.new(msg: " -THR LEVER......FWD THR", colour: "c"),
# ENG 1 FAIL
var eng1Fail = warning.new(msg: "ENG 1 FAIL ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var thrustMalfunction1 = warning.new(msg: " THRUST MALFUNCTION ", colour: "a"),
var shaftFailure1 = warning.new(msg: " SHAFT FAILURE ", colour: "a"),
var eng1FailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
var eng1FailThrLvrIdle = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"),
var eng1FailNoRelight = warning.new(msg: "•IF NO RELIGHT AFTER 30S", colour: "w"),
var eng1FailMasterOff = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"),
var eng1FailDamage = warning.new(msg: " IF DAMAGE : ", colour: "w"),
var eng1FailFirePB = warning.new(msg: " -ENG 1 FIRE P/B....PUSH", colour: "c"),
var eng1FailAgent1DischT = warning.new(msg: " -AGENT1 AFTER 10S.DISCH", colour: "c"),
var eng1FailAgent1Disch = warning.new(msg: " -AGENT 1..........DISCH", colour: "c"),
var eng1FailNoDamage = warning.new(msg: " IF NO DAMAGE : ", colour: "w"),
var eng1FailRelight = warning.new(msg: " -ENG 1 RELIGHT.CONSIDER", colour: "c"),
# ENG 1 OIL HI TEMP
var eng1OilHiTemp = warning.new(msg: "ENG 1 OIL HI TEMP ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng1OilHiTempIdle = warning.new(msg: " -THR LEVER 1.......IDLE", colour: "c"),
var eng1OilHiTempSuccess = warning.new(msg: " •IF UNSUCCESSFUL: ", colour: "w"),
var eng1OilHiTempMaster = warning.new(msg: " -ENG MASTER 1.......OFF", colour: "c"),
# ENG 1 SHUT DOWN
var eng1ShutDown = warning.new(msg: "ENG 1 SHUT DOWN ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng1ShutDownPack = warning.new(msg: " -PACK 1.............OFF", colour: "c"),
var eng1ShutDownXBleed = warning.new(msg: " -X BLEED...........OPEN", colour: "c"),
var eng1ShutDownModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
var eng1ShutDownFuelLeak = warning.new(msg: " •IF NO FUEL LEAK :", colour: "w"),
var eng1ShutDownImbalance = warning.new(msg: " -IMBALANCE......MONITOR", colour: "c"),
var eng1ShutDownTCAS = warning.new(msg: " -TCAS MODE SEL.......TA", colour: "c"),
var eng1ShutDownBuffet = warning.new(msg: " •IF BUFFET : ", colour: "w"),
var eng1ShutDownSpeed = warning.new(msg: " MAX SPEED...........240", colour: "c"),
var eng1ShutDownXBleedS = warning.new(msg: " -X BLEED...........SHUT", colour: "c"),
var eng1ShutDownWingAI = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var eng1ShutDownIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
# ENG 2 FAIL
var eng2Fail = warning.new(msg: "ENG 2 FAIL ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var thrustMalfunction2 = warning.new(msg: " THRUST MALFUNCTION ", colour: "a"),
var shaftFailure2 = warning.new(msg: " SHAFT FAILURE ", colour: "a"),
var eng2FailModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
var eng2FailThrLvrIdle = warning.new(msg: " -THR LEVER 2.......IDLE", colour: "c"),
var eng2FailNoRelight = warning.new(msg: "•IF NO RELIGHT AFTER 30S", colour: "w"),
var eng2FailMasterOff = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"),
var eng2FailDamage = warning.new(msg: " IF DAMAGE : ", colour: "w"),
var eng2FailFirePB = warning.new(msg: " -ENG 2 FIRE P/B....PUSH", colour: "c"),
var eng2FailAgent1DischT = warning.new(msg: " -AGENT2 AFTER 10S.DISCH", colour: "c"),
var eng2FailAgent1Disch = warning.new(msg: " -AGENT 2..........DISCH", colour: "c"),
var eng2FailNoDamage = warning.new(msg: " IF NO DAMAGE : ", colour: "w"),
var eng2FailRelight = warning.new(msg: " -ENG 2 RELIGHT.CONSIDER", colour: "c"),
# ENG 2 OIL HI TEMP
var eng2OilHiTemp = warning.new(msg: "ENG 2 OIL HI TEMP ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng2OilHiTempIdle = warning.new(msg: " -THR LEVER 2.......IDLE", colour: "c"),
var eng2OilHiTempSuccess = warning.new(msg: " •IF UNSUCCESSFUL: ", colour: "w"),
var eng2OilHiTempMaster = warning.new(msg: " -ENG MASTER 2.......OFF", colour: "c"),
# ENG 2 SHUT DOWN
var eng2ShutDown = warning.new(msg: "ENG 2 SHUT DOWN ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var eng2ShutDownPack1 = warning.new(msg: " -PACK 1.............OFF", colour: "c"),
var eng2ShutDownPack = warning.new(msg: " -PACK 2.............OFF", colour: "c"),
var eng2ShutDownXBleed = warning.new(msg: " -X BLEED...........OPEN", colour: "c"),
var eng2ShutDownModeSel = warning.new(msg: " -ENG MODE SEL.......IGN", colour: "c"),
var eng2ShutDownFuelLeak = warning.new(msg: " •IF NO FUEL LEAK :", colour: "w"),
var eng2ShutDownImbalance = warning.new(msg: " -IMBALANCE......MONITOR", colour: "c"),
var eng2ShutDownTCAS = warning.new(msg: " -TCAS MODE SEL.......TA", colour: "c"),
var eng2ShutDownBuffet = warning.new(msg: " •IF BUFFET : ", colour: "w"),
var eng2ShutDownSpeed = warning.new(msg: " MAX SPEED...........240", colour: "c"),
var eng2ShutDownXBleedS = warning.new(msg: " -X BLEED...........SHUT", colour: "c"),
var eng2ShutDownWingAI = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var eng2ShutDownIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
# SAT ABOVE FLEX TEMP
var satAbvFlexTemp = warning.new(msg: "ENG SAT ABOVE FLEX TEMP", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var satAbvFlexTempCheck = warning.new(msg: " -T.O DATA.........CHECK", colour: "c"),
# B RSVR LO LVL
var hydBSysLoLvl = warning.new(msg: "HYD B RSVR LO LVL ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var hydBSysLoLvlPump = warning.new(msg: " -BLUE ELEC PUMP.....OFF ", colour: "c"),
# G RSVR LO LVL
var hydGSysLoLvl = warning.new(msg: "HYD G RSVR LO LVL ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var hydGSysLoLvlPtu = warning.new(msg: " -PTU................OFF ", colour: "c"),
var hydGSysLoLvlPump = warning.new(msg: " -GREEN ENG 1 PUMP...OFF ", colour: "c"),
# Y RSVR LO LVL
var hydYSysLoLvl = warning.new(msg: "HYD Y RSVR LO LVL ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var hydYSysLoLvlPtu = warning.new(msg: " -PTU................OFF ", colour: "c"),
var hydYSysLoLvlPump = warning.new(msg: " -YELLOW ENG 2 PUMP..OFF ", colour: "c"),
var hydYSysLoLvlElec = warning.new(msg: " -YELLOW ELEC PUMP...OFF ", colour: "c"),
# B SYS LO PR
var hydBSysLoPr = warning.new(msg: "HYD B SYS LO PR ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var hydBSysLoPrFuel = warning.new(msg: " FUEL CONSUMPT INCRSD ", colour: "c"),
var hydBSysLoPrFmsPred = warning.new(msg: " FMS PRED UNRELIABLE ", colour: "c"),
# G SYS LO PR
var hydGSysLoPr = warning.new(msg: "HYD G SYS LO PR ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var hydGSysLoPrFuel = warning.new(msg: " FUEL CONSUMPT INCRSD ", colour: "c"),
var hydGSysLoPrFmsPred = warning.new(msg: " FMS PRED UNRELIABLE ", colour: "c"),
var hydGSysLoPrEngPump = warning.new(msg: " G ENG 1 PUMP LO PR ", colour: "a"),
# Y SYS LO PR
var hydYSysLoPr = warning.new(msg: "HYD Y SYS LO PR ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var hydYSysLoPrAccu = warning.new(msg: " BRK Y ACCU PR MONITOR ", colour: "c"),
var hydYSysLoPrFuel = warning.new(msg: " FUEL CONSUMPT INCRSD ", colour: "c"),
var hydYSysLoPrFmsPred = warning.new(msg: " FMS PRED UNRELIABLE ", colour: "c"),
var hydYSysLoPrEngPump = warning.new(msg: " Y ENG 2 PUMP LO PR ", colour: "a"),
# DC EMER CONFIG
var dcEmerconfig = warning.new(msg: "ELEC DC EMER CONFIG", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var dcEmerconfigManOn = warning.new(msg: " -EMER ELEC PWR...MAN ON", colour: "c"),
var dcEmerconfigFuel = warning.new(msg: " FUEL CONSUMPT INCRSD", colour: "c"),
# DC BUS 1 OR 2 FAULT
var dcBus12Fault = warning.new(msg: "ELEC DC BUS 1+2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var dcBus12FaultBlower = warning.new(msg: " -BLOWER............OVRD", colour: "c"),
var dcBus12FaultExtract = warning.new(msg: " -EXTRACT...........OVRD", colour: "c"),
var dcBus12FaultBaroRef = warning.new(msg: " -BARO REF.........CHECK", colour: "c"),
var dcBus12FaultFuel = warning.new(msg: " FUEL CONSUMPT INCRSD", colour: "c"),
var dcBus12FaultPredict = warning.new(msg: " FMS PRED UNRELIABLE", colour: "c"),
var dcBus12FaultIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var dcBus12FaultBrking = warning.new(msg: " MAX BRK........1000 PSI", colour: "c"),
@ -216,21 +404,30 @@ var warnings = std.Vector.new([
var DcEssBusFaultRadio = warning.new(msg: " -VHF 2 OR 3.........USE", colour: "c"),
var DcEssBusFaultRadio2 = warning.new(msg: " -AUDIO SWTG......SELECT", colour: "c"),
var DcEssBusFaultBaro = warning.new(msg: " -BARO REF.........CHECK", colour: "c"),
var DcEssBusFaultGPWS = warning.new(msg: " -GPWS...............OFF", colour: "c"),
var DcEssBusFaultGear = warning.new(msg: " -L/G.........GRVTY EXTN", colour: "c"),
var DcEssBusFaultGPWS = warning.new(msg: " -GPWS SYS...........OFF", colour: "c"),
var DcEssBusFaultFuel = warning.new(msg: " FUEL CONSUMPT INCRSD", colour: "c"),
var DcEssBusFaultPredict = warning.new(msg: " FMS PRED UNRELIABLE", colour: "c"),
var DcEssBusFaultIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
# AC BUS 2 FAULT
var AcBus2Fault = warning.new(msg: "ELEC AC BUS 2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var AcBus2FaultExtract = warning.new(msg: " -EXTRACT...........OVRD", colour: "c"),
var AcBus2FaultAtc = warning.new(msg: " -ATC..............SYS 1", colour: "c"),
# DC BUS 1 FAULT
var dcBus1Fault = warning.new(msg: "ELEC DC BUS 1 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var dcBus1FaultBlower = warning.new(msg: " -BLOWER............OVRD", colour: "c"),
var dcBus1FaultExtract = warning.new(msg: " -EXTRACT...........OVRD", colour: "c"),
var dcBus1FaultIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
# DC BUS 2 FAULT
var dcBus2Fault = warning.new(msg: "ELEC DC BUS 2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var dcBus2FaultAirData = warning.new(msg: " -AIR DATA SWTG......F/O", colour: "c"),
var dcBus2FaultBaro = warning.new(msg: " -BARO REF.........CHECK", colour: "c"),
var dcBus2FaultGear = warning.new(msg: " -L/G.........GRVTY EXTN", colour: "c"),
var dcBus2FaultFuel = warning.new(msg: " FUEL CONSUMPT INCRSD", colour: "c"),
var dcBus2FaultPredict = warning.new(msg: " FMS PRED UNRELIABLE", colour: "c"),
# DC BAT BUS FAULT
var dcBusBatFault = warning.new(msg: "ELEC DC BAT BUS FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
@ -244,12 +441,21 @@ var warnings = std.Vector.new([
var acBusEssShed = warning.new(msg: "ELEC AC ESS BUS SHED", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var acBusEssShedAtc = warning.new(msg: " -ATC..............SYS 2", colour: "c"),
# IDG 1 DISCONNECTED
var idg1Disc = warning.new(msg: "ELEC IDG 1 DISCONNECTED", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# IDG 2 DISCONNECTED
var idg2Disc = warning.new(msg: "ELEC IDG 2 DISCONNECTED", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# GEN 1 FAULT
var gen1fault = warning.new(msg: "ELEC GEN 1 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var gen1faultGen = warning.new(msg: " -GEN 1......OFF THEN ON", colour: "c"),
var gen1faultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"),
var gen1faultGen3 = warning.new(msg: " -GEN 1..............OFF", colour: "c"),
# ESS TR FAULT
var essTRFault = warning.new(msg: "ELEC ESS TR FAULT ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# GEN 2 FAULT
var gen2fault = warning.new(msg: "ELEC GEN 2 FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var gen2faultGen = warning.new(msg: " -GEN 2......OFF THEN ON", colour: "c"),
@ -262,6 +468,13 @@ var warnings = std.Vector.new([
var apuGenfaultGen2 = warning.new(msg: " •IF UNSUCCESSFUL :", colour: "w"),
var apuGenfaultGen3 = warning.new(msg: " -APU GEN............OFF", colour: "c"),
# GEN OFF
var gen1Off = warning.new(msg: "ELEC GEN 1 OFF ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var gen2Off = warning.new(msg: "ELEC GEN 2 OFF ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# APU GEN FAULT
var acEssBusAltn = warning.new(msg: "ELEC AC ESS BUS ALTN", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# L ELEV FAULT
var lElevFault = warning.new(msg: "F/CTL L ELEV FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var lElevFaultCare = warning.new(msg: " MANEUVER WITH CARE", colour: "c"),
@ -272,6 +485,9 @@ var warnings = std.Vector.new([
var rElevFaultCare = warning.new(msg: " MANEUVER WITH CARE", colour: "c"),
var rElevFaultPitch = warning.new(msg: " FOR GA:MAX PITCH 15 DEG", colour: "c"),
# F/CTL SPD BRK STILL OUT
var fctlSpdBrkStillOut = warning.new(msg: "F/CTL SPD BRK STILL OUT ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
# DIRECT LAW
var directLaw = warning.new(msg: "F/CTL DIRECT LAW", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var directLawProt = warning.new(msg: " (PROT LOST)", colour: "a"),
@ -342,6 +558,24 @@ var warnings = std.Vector.new([
var fcuFault2 = warning.new(msg: "AUTO FLT FCU 2 FAULT", colour: "a", isMainMsg: 1),
var fcuFault2Baro = warning.new(msg: " -BARO REF.......X CHECK", colour: "c"),
# FUEL
var wingLoLvl = warning.new(msg: "FUEL L+R WING TK LO LVL", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var wingLoLvlManMode = warning.new(msg: " -FUEL MODE SEL......MAN", colour: "c"),
var wingLoLvlPumpL1 = warning.new(msg: " -L TK PUMP 1.........ON", colour: "c"),
var wingLoLvlPumpL2 = warning.new(msg: " -L TK PUMP 2.........ON", colour: "c"),
var wingLoLvlPumpC1 = warning.new(msg: " -CTR TK PUMP 1.......ON", colour: "c"),
var wingLoLvlPumpR1 = warning.new(msg: " -R TK PUMP 1.........ON", colour: "c"),
var wingLoLvlPumpR2 = warning.new(msg: " -R TK PUMP 2.........ON", colour: "c"),
var wingLoLvlPumpC2 = warning.new(msg: " -CTR TK PUMP 2.......ON", colour: "c"),
var wingLoLvlLeak = warning.new(msg: " •IF NO FUEL LEAK: ", colour: "w"),
var wingLoLvlXFeed = warning.new(msg: " -FUEL X FEED.........ON", colour: "c"),
var wingLoLvlGrav = warning.new(msg: " •IF GRVTY FEED: ", colour: "w"),
var wingLoLvlXFeedOff = warning.new(msg: " -FUEL X FEED........OFF", colour: "c"),
var ctrPumpsOff = warning.new(msg: "FUEL CTR TK PUMPS OFF ", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var ctrPumpsOffPump1 = warning.new(msg: " -CTR TK PUMP 1.......ON", colour: "c"),
var ctrPumpsOffPump2 = warning.new(msg: " -CTR TK PUMP 2.......ON", colour: "c"),
# APU shutdown
var apuEmerShutdown = warning.new(msg: "APU EMER SHUT DOWN", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var apuEmerShutdownMast = warning.new(msg: " -MASTER SW..........OFF", colour: "c"),
@ -362,8 +596,8 @@ var warnings = std.Vector.new([
var hpValve2Fault = warning.new(msg: "AIR ENG 2 HP VALVE FAULT", colour: "a"),
var xBleedFault = warning.new(msg: "AIR X BLEED FAULT", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var xBleedFaultMan = warning.new(msg: " -X BLEED........MAN CTL", colour: "c"),
var xBleedOff = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var xBleedIcing = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var xBleedFaultWAI = warning.new(msg: " -WING ANTI ICE......OFF", colour: "c"),
var xBleedFaultICE = warning.new(msg: " AVOID ICING CONDITIONS", colour: "c"),
var bleed1Off = warning.new(msg: "AIR BLEED 1 OFF", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var bleed2Off = warning.new(msg: "AIR BLEED 2 OFF", colour: "a", aural: 1, light: 1, isMainMsg: 1),
var engBleedLowTemp = warning.new(msg: "AIR ENG 1+2 BLEED LO TEMP", colour: "a", aural: 1, light: 1, isMainMsg: 1),
@ -525,9 +759,11 @@ var leftmemos = std.Vector.new([
var strobe_lt_off = warning.new(msg: "STROBE LT OFF" ),
var outr_tk_fuel_xfrd = warning.new(msg: "OUTR TK FUEL XFRD" ),
var fob_3T = warning.new(msg: "FOB BELOW 3T" ),
var fob_66L = warning.new(msg: "FOB BELOW 6600LBS" ),
var gpws_flap_mode_off = warning.new(msg: "GPWS FLAP MODE OFF" ),
var atc_datalink_stby = warning.new(msg: "ATC DATALINK STBY" ), # Not yet implemented
var company_datalink_stby = warning.new(msg: "COMPANY DATALINK STBY"), # Not yet implemented
var acars_stby = warning.new(msg: "ACARS STBY" ), # Not yet implemented
]);
# Right E/WD

View file

@ -66,7 +66,7 @@ var FCUController = {
me.FCU2 = FCU.new(systems.ELEC.Bus.dc2);
me._init = 1;
},
loop: func() {
loop: func(notification) {
if (me._init == 0) { return; }
# Update FCU Power
@ -82,11 +82,11 @@ var FCUController = {
}
foreach (var update_item; me.update_items) {
update_item.update(nil);
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)
props.UpdateManager.FromPropertyHashList(["/it-autoflight/output/fd1","/it-autoflight/output/fd2", "/it-autoflight/output/ap1", "/it-autoflight/output/ap2"], nil, func(notification)
{
updateActiveFMGC();
}

View file

@ -134,13 +134,15 @@ var SimbriefParser = {
fmgc.flightPlanController.flightplans[3].destination_runway = runwayStore;
}
var alternateID = me.OFP.getNode("alternate/icao_code").getValue();
var alternateID = me.OFP.getNode("alternate/icao_code") == nil ? nil : me.OFP.getNode("alternate/icao_code").getValue();
if (alternateID != nil) {
var alternates = findAirportsByICAO(alternateID);
if (alternates != nil and size(alternates) != 0) {
if (size(alternates) != 0) {
fmgc.FMGCInternal.altAirport = alternateID;
atsu.ATISInstances[2].newStation(alternateID);
fmgc.FMGCInternal.altAirportSet = 1;
}
}
var wps = [];
var ofpNavlog = me.OFP.getNode("navlog");

View file

@ -428,13 +428,14 @@ var flightPlanController = {
# flag: is it a navaids DUPLICATENAMES page or not?
# plan: plan
# flagPBD: do we return back to PBD handler or to default waypoint handler?
# flagPROG: do we return back to PROG handler or to default waypoint handler (only if flagPBD false)
createDuplicateNames: func(ghostContainer, index, flag, plan, flagPBD = 0, bearing = -999, distance = -99) {
createDuplicateNames: func(ghostContainer, index, flag, plan, flagPBD = 0, bearing = -999, distance = -99, flagPROG = 0) {
if (canvas_mcdu.myDuplicate[plan] != nil) {
canvas_mcdu.myDuplicate[plan].del();
}
canvas_mcdu.myDuplicate[plan] = nil;
canvas_mcdu.myDuplicate[plan] = mcdu.duplicateNamesPage.new(ghostContainer, index, flag, plan, flagPBD, bearing, distance);
canvas_mcdu.myDuplicate[plan] = mcdu.duplicateNamesPage.new(ghostContainer, index, flag, plan, flagPBD, bearing, distance, flagPROG);
setprop("MCDU[" ~ plan ~ "]/page", "DUPLICATENAMES");
},
@ -639,9 +640,9 @@ var flightPlanController = {
}
} else {
if (type == "navaid") {
me.createDuplicateNames(wpGhostContainer, index, 1, plan, 1, num(textSplit[1]), num(textSplit[2]));
me.createDuplicateNames(wpGhostContainer, index, 1, plan, 1, num(textSplit[1]), num(textSplit[2]), 0);
} else {
me.createDuplicateNames(wpGhostContainer, index, 0, plan, 1, num(textSplit[1]), num(textSplit[2]));
me.createDuplicateNames(wpGhostContainer, index, 0, plan, 1, num(textSplit[1]), num(textSplit[2]), 0);
}
return 2;
}

View file

@ -32,7 +32,7 @@ var variousReset = func() {
setprop("/controls/CVR/gndctl", 0);
setprop("/controls/CVR/erase", 0);
setprop("/controls/switches/pneumatics/cabin-fans", 1);
setprop("/controls/oxygen/crewOxyPB", 1); # 0 = OFF 1 = AUTO
setprop("/controls/oxygen/crewOxyPB", 0); # 0 = OFF 1 = AUTO
setprop("/controls/switches/emerCallLtO", 0); # ON light, flashes white for 10s
setprop("/controls/switches/emerCallLtC", 0); # CALL light, flashes amber for 10s
setprop("/controls/switches/emerCall", 0);
@ -62,8 +62,9 @@ var variousReset = func() {
setprop("/modes/fcu/hdg-time", -45);
setprop("/controls/navigation/switching/att-hdg", 0);
setprop("/controls/navigation/switching/air-data", 0);
setprop("/controls/switches/no-smoking-sign", 0.5);
setprop("/controls/switches/seatbelt-sign", 1);
setprop("/controls/switches/no-smoking-sign", 0.0);
setprop("/controls/switches/seatbelt-sign", 0);
setprop("/controls/switches/emer-lights", 0);
}
var BUTTONS = {

View file

@ -174,19 +174,18 @@ var update_items = [
var systemsLoop = func(notification) {
if (!systemsInitialized) { return; }
systems.ELEC.loop();
systems.PNEU.loop();
systems.HYD.loop();
systems.ADIRS.loop();
systems.PNEU.loop(notification);
systems.ADIRS.loop(notification);
systems.BrakeSys.update(notification);
systems.HFLoop(notification);
systems.APUController.loop();
systems.BrakeSys.update();
fadec.FADEC.loop();
rmp.rmpUpdate();
fcu.FCUController.loop();
fcu.FCUController.loop(notification);
atc.Transponders.vector[atc.transponderPanel.atcSel - 1].update(notification);
dmc.DMController.loop();
atsu.ATSU.loop();
libraries.BUTTONS.update();
systems.HFLoop(notification);
if ((notification.engine1State == 2 or notification.engine1State == 3) and collectorTankL.getValue() < 1) {
systems.cutoff_one();
@ -203,10 +202,12 @@ var systemsLoop = func(notification) {
# GPWS
var GPWS = {
inhibitNode: props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/gpws-inhibit"),
tatcfInhibit: props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit"),
volume: props.globals.getNode("/instrumentation/mk-viii/speaker/volume"),
flapAllOverride: props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap-all-override"),
flap3Override: props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override"),
flapOverride: props.globals.getNode("/instrumentation/mk-viii/inputs/discretes/momentary-flap-override"),
alertMode: props.globals.initNode("/instrumentation/mk-viii/outputs/alert-mode",0,"INT"),
};
setlistener("/instrumentation/mk-viii/inputs/discretes/gpws-inhibit", func() {
@ -233,6 +234,20 @@ setlistener("/instrumentation/mk-viii/inputs/discretes/momentary-flap-3-override
updateGPWSFlap();
}, 0, 0);
# GPWS alert pooling for get mode change - a little esoteric way but it works
var gpws_alert_watch = maketimer(0.8,func {
var alert = 0;
if (getprop("instrumentation/mk-viii/outputs/discretes/gpws-warning")) alert = 2; # MODE2 - warning - RED
else if (getprop("instrumentation/mk-viii/outputs/discretes/gpws-alert")) alert = 1; # MODE1 - caution - YELLOW
if (GPWS.alertMode.getValue()!=alert) GPWS.alertMode.setValue(alert);
});
setlistener("/instrumentation/mk-viii/inputs/discretes/ta-tcf-inhibit", func{ # detect GPWS switch status
var failure = GPWS.tatcfInhibit.getBoolValue();
if (!failure) gpws_alert_watch.start();
else gpws_alert_watch.stop();
},1,0);
# Replay
var replayState = props.globals.getNode("/sim/replay/replay-state");
setlistener("/sim/replay/replay-state", func() {

View file

@ -173,6 +173,13 @@ var Instrumentation = {
pnlModeNum: [props.globals.initNode("/instrumentation/efis[0]/mfd/pnl_mode-num", 2, "INT"), props.globals.initNode("/instrumentation/efis[1]/mfd/pnl_mode-num", 2, "INT")],
},
},
GPS: {
altitude: props.globals.getNode("/instrumentation/gps/indicated-altitude-ft"),
latitude: props.globals.getNode("/instrumentation/gps/indicated-latitude-deg"),
longitude: props.globals.getNode("/instrumentation/gps/indicated-longitude-deg"),
trackMag: props.globals.getNode("/instrumentation/gps/indicated-track-magnetic-deg"),
gs: props.globals.getNode("/instrumentation/gps/indicated-ground-speed-kt"),
},
MKVII: {
Inputs: {
Discretes: {
@ -245,6 +252,7 @@ var Sim = {
Time: {
deltaRealtimeSec: props.globals.getNode("/sim/time/delta-realtime-sec"),
elapsedSec: props.globals.getNode("/sim/time/elapsed-sec"),
gmtString: props.globals.getNode("/sim/time/gmt-string"),
UTC: {
day: props.globals.getNode("/sim/time/utc/day"),
month: props.globals.getNode("/sim/time/utc/month"),

View file

@ -74,29 +74,44 @@ var closestAirportPage = {
me._range += 250;
}
}
if (size(me.airports) >= 1) {
me.L1 = [me.airports[0].id, nil, "grn"];
me.R1 = ["----", "UTC ", "grn"];
}
if (size(me.airports) >= 2) {
me.L2 = [me.airports[1].id, nil, "grn"];
me.R2 = ["----", nil, "grn"];
}
if (size(me.airports) >= 3) {
me.L3 = [me.airports[2].id, nil, "grn"];
me.R3 = ["----", nil, "grn"];
}
if (size(me.airports) >= 4) {
me.L4 = [me.airports[3].id, nil, "grn"];
me.R4 = ["----", nil, "grn"];
}
me.listPopulated = 1;
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
},
updateBrgDist: func() {
if (!me.listPopulated) { return; }
me.cdVector[0] = courseAndDistance(me.airports[0]);
me.cdVector[1] = courseAndDistance(me.airports[1]);
me.cdVector[2] = courseAndDistance(me.airports[2]);
me.cdVector[3] = courseAndDistance(me.airports[3]);
var magvarLocal = magvar();
if (size(me.airports) >= 1) {
me.cdVector[0] = courseAndDistance(me.airports[0]);
me.C1 = [math.round(me.cdVector[0][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[0][1]), " BRG DIST", "grn"];
}
if (size(me.airports) >= 2) {
me.cdVector[1] = courseAndDistance(me.airports[1]);
me.C2 = [math.round(me.cdVector[1][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[1][1]) , nil, "grn"];
}
if (size(me.airports) >= 3) {
me.cdVector[2] = courseAndDistance(me.airports[2]);
me.C3 = [math.round(me.cdVector[2][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[2][1]), nil, "grn"];
}
if (size(me.airports) >= 4) {
me.cdVector[3] = courseAndDistance(me.airports[3]);
me.C4 = [math.round(me.cdVector[3][0] - magvarLocal) ~ " " ~ math.round(me.cdVector[3][1]), nil, "grn"];
}
if (me.manAirport != nil) {
me.C5 = [math.round(courseAndDistance(me.manAirport)[0] - magvarLocal) ~ " " ~ math.round(courseAndDistance(me.manAirport)[1]), nil, "grn"];
}

View file

@ -5,19 +5,18 @@
var dataInput = func(key, i) {
if (key == "L1") {
setprop("MCDU[" ~ i ~ "]/page", "POSMON");
}
if (key == "L2") {
} elsif (key == "L2") {
setprop("MCDU[" ~ i ~ "]/page", "IRSMON");
}
if (key == "L5") {
} elsif (key == "L3") {
setprop("MCDU[" ~ i ~ "]/page", "GPSMON");
} elsif (key == "L5") {
if (canvas_mcdu.myClosestAirport[i] != nil) {
canvas_mcdu.myClosestAirport[i].del();
}
canvas_mcdu.myClosestAirport[i] = nil;
canvas_mcdu.myClosestAirport[i] = closestAirportPage.new(i);
setprop("MCDU[" ~ i ~ "]/page", "CLOSESTAIRPORT");
}
if (key == "R5") {
} elsif (key == "R5") {
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
}
}
@ -25,23 +24,17 @@ var dataInput = func(key, i) {
var printInput = func(key, i) {
if (key == "L1") {
setprop("FMGC/print/mcdu/page1/L1auto", 1);
}
if (key == "L2") {
} elsif (key == "L2") {
setprop("FMGC/print/mcdu/page1/L2auto", 1);
}
if (key == "L3") {
} elsif (key == "L3") {
setprop("FMGC/print/mcdu/page1/L3auto", 1);
}
if (key == "L5") {
} elsif (key == "L5") {
setprop("MCDU[" ~ i ~ "]/page", "DATA");
}
if (key == "R1") {
} elsif (key == "R1") {
setprop("FMGC/print/mcdu/page1/R1req", 1);
}
if (key == "R2") {
} elsif (key == "R2") {
setprop("FMGC/print/mcdu/page1/R2req", 1);
}
if (key == "R3") {
} elsif (key == "R3") {
setprop("FMGC/print/mcdu/page1/R3req", 1);
}
}
@ -49,29 +42,21 @@ var printInput = func(key, i) {
var printInput2 = func(key, i) {
if (key == "L1") {
setprop("FMGC/print/mcdu/page2/L1auto", 1);
}
if (key == "L2") {
} elsif (key == "L2") {
setprop("FMGC/print/mcdu/page2/L2auto", 1);
}
if (key == "L3") {
} elsif (key == "L3") {
setprop("FMGC/print/mcdu/page2/L3auto", 1);
}
if (key == "L4") {
} elsif (key == "L4") {
setprop("FMGC/print/mcdu/page2/L4auto", 1);
}
if (key == "L6") {
} elsif (key == "L6") {
setprop("MCDU[" ~ i ~ "]/page", "DATA");
}
if (key == "R1") {
} elsif (key == "R1") {
setprop("FMGC/print/mcdu/page2/R1req", 1);
}
if (key == "R2") {
} elsif (key == "R2") {
setprop("FMGC/print/mcdu/page2/R2req", 1);
}
if (key == "R3") {
} elsif (key == "R3") {
setprop("FMGC/print/mcdu/page2/R3req", 1);
}
if (key == "R4") {
} elsif (key == "R4") {
setprop("FMGC/print/mcdu/page2/R4req", 1);
}
}

View file

@ -28,7 +28,7 @@ var duplicateNamesPage = {
enableScroll: 0,
scroll: 0,
distances: nil,
new: func(vector, index, type, computer, flagPBD = 0, pbdBrg = -999, pbdDist = -99) {
new: func(vector, index, type, computer, flagPBD = 0, pbdBrg = -999, pbdDist = -99, flagProg = 0) {
var dn = {parents:[duplicateNamesPage]};
dn.vector = vector;
dn.index = index;
@ -37,6 +37,7 @@ var duplicateNamesPage = {
dn.bearing = pbdBrg;
dn.distance = pbdDist;
dn.computer = computer;
dn.flagPROG = flagProg;
dn._setupPageWithData();
dn.distances = [];
return dn;
@ -134,7 +135,7 @@ var duplicateNamesPage = {
},
pushButtonLeft: func(indexSelect) {
if (!dirToFlag) {
if (!me.flagPBD) {
if (!me.flagPBD and !me.flagPROG) {
if (size(me.vector[0].id) == 5) {
fmgc.flightPlanController.insertFix(me.vector[0].id, me.index, me.computer, 1, indexSelect - 1);
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
@ -145,9 +146,16 @@ var duplicateNamesPage = {
fmgc.flightPlanController.insertNavaid(me.vector[0].id, me.index, me.computer, 1, indexSelect - 1);
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
}
} else {
} elsif (me.flagPBD) {
fmgc.flightPlanController.getWPforPBD(me.vector[0].id ~ "/" ~ me.bearing ~ "/" ~ me.distance, me.index, me.computer, 1, indexSelect - 1);
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
} else {
if (me.type == 0) {
mcdu.bearingDistances[me.computer].newPointResult(me.vector, 1, indexSelect - 1);
} else {
mcdu.bearingDistances[me.computer].newPointNavaid(me.vector, 1, indexSelect - 1);
}
pagebutton("prog",me.computer);
}
} else {
canvas_mcdu.myDirTo[me.computer].fieldL1(me.vector[0].id, 1, indexSelect - 1);

View file

@ -117,15 +117,15 @@ var fplnItem = {
},
getAlt: func() {
if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.flightPlanController.flightplans[me.plan].departure != nil) {
return [" " ~ sprintf("%5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "grn"]; #fixed - aligned to right
return [" " ~ sprintf("%5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "grn"];
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) {
return [" " ~ fmgc.flightPlanController.fromWptAlt, "mag"];
} elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr > 0) {
var tcol = (me.wp.alt_cstr_type == "computed" or me.wp.alt_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
if (me.wp.alt_cstr > fmgc.FMGCInternal.transAlt) {
return [" " ~ sprintf("%5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), tcol]; #fixed - aligned to right
return [" " ~ sprintf("%5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), tcol];
} else {
return [" " ~ sprintf("%5.0f", me.wp.alt_cstr), tcol]; #fixed - aligned to right
return [" " ~ sprintf("%5.0f", me.wp.alt_cstr), tcol];
}
} else {
return ["------", "wht"];

View file

@ -128,6 +128,7 @@ var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/positio
# Detect OFF without IN
var lastgs0 = 0;
#var lastgear0 = 0;
var lastgsrestart = 0;
# Check for A/C state change - advice me for a better method, please :/
@ -144,7 +145,6 @@ var waitingOOOIChange = maketimer(1, func(){ # 1sec precision
if (gs > 9) { # imho - it's useful few speed tollerance, 10kts min speed on taxiways - CHECKME - better with pushback detection?
FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
expectedOOOIState = 1;
lastgear0 = 0;
}
}
} else if (expectedOOOIState == 1) { # OFF
@ -162,7 +162,7 @@ var waitingOOOIChange = maketimer(1, func(){ # 1sec precision
if (gear0 and (phase == 7 or phase == 0)) { #done or preflight
FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
expectedOOOIState = 3;
lastgear0 = 0;
lastgs0 = 0;
lastgsrestart = 0;
}
} else if (expectedOOOIState == 3) { # IN
@ -177,9 +177,9 @@ var waitingOOOIChange = maketimer(1, func(){ # 1sec precision
}
}
else if (!gear0) { # OFF without IN -> TO without stop and opening doors
if (lastgear0) FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState,lastgear0)); # IN (estimated)
if (lastgs0>0) FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState,lastgs0)); # IN (estimated)
FlightLogDatabase.addPage();
if (lastgsrestart) FlightLogDatabase.addReport(OOOIReport.new(0,lastgsrestart)); # OUT (estimated)
if (lastgsrestart>0) FlightLogDatabase.addReport(OOOIReport.new(0,lastgsrestart)); # OUT (estimated)
expectedOOOIState = 1; # go on to OFF state
}
else if (gs > 9 and lastgsrestart == 0) { # try to detect OFF without IN

View file

@ -238,6 +238,7 @@ var initInputA = func(key, i) {
fmgc.flightPlanController.reset(2);
fmgc.flightPlanController.init();
Simbrief.SimbriefParser.inhibit = 0;
fmgc.updateARPT();
mcdu_scratchpad.scratchpads[i].empty();
#} else if (scratchpad == "") {
#fmgc.FMGCInternal.altSelected = 0;
@ -264,6 +265,7 @@ var initInputA = func(key, i) {
mcdu_scratchpad.scratchpads[i].empty();
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
fmgc.FMGCInternal.altSelected = 0;
fmgc.updateARPT();
fmgc.updateArptLatLon();
#setprop("MCDU[" ~ i ~ "]/page", "ROUTESELECTION");
} else {

View file

@ -241,7 +241,7 @@ var lskbutton = func(btn, i) {
progTOInput("L1",i); # same fn as TO
} else if (page == "PROGTO") {
progTOInput("L1",i);
} else if (page == "PROGCLB") {
} else if (page == "PROGCLB" or page == "PROGAPPR") { # APPR restore to CLB
progCLBInput("L1",i);
} else if (page == "PROGCRZ") {
progCRZInput("L1",i);
@ -534,6 +534,8 @@ var lskbutton = func(btn, i) {
statusInput("L3",i);
} else if (page == "RADNAV") {
radnavInput("L3",i);
} else if (page == "DATA") {
dataInput("L3",i);
} else if (page == "PRINTFUNC") {
printInput("L3",i);
} else if (page == "PRINTFUNC2") {
@ -634,6 +636,8 @@ var lskbutton = func(btn, i) {
mcdu_scratchpad.scratchpads[i].empty();
}
}
} else if (page == "VERTREV") {
canvas_mcdu.myVertRev[i].pushButtonLeft(3);
} else if (page == "MCDUTEXT") {
atsu.freeTexts[i].selection = 2;
atsu.freeTexts[i].changed = 1;
@ -853,7 +857,13 @@ var lskbutton = func(btn, i) {
} else if (page == "F-PLNA" or page == "F-PLNB") {
canvas_mcdu.myFpln[i].pushButtonLeft(6);
} else if (page == "LATREV" or page == "VERTREV" or page == "DUPLICATENAMES") {
if (page != "DUPLICATENAMES") {
pageNode[i].setValue("F-PLNA");
} else {
if (canvas_mcdu.myDuplicate[i] != nil and canvas_mcdu.myDuplicate[i].flagPROG) {
pagebutton("prog",i);
}
}
} else if (page == "ARRIVAL") {
canvas_mcdu.myArrival[i].arrPushbuttonLeft(6);
} else if (page == "DEPARTURE" or page == "HOLD" or page == "AIRWAYS") {
@ -887,6 +897,8 @@ var lskbutton = func(btn, i) {
pageNode[i].setValue("ATIS");
} else if (page == "AOCCONFIG") {
pageNode[i].setValue("AOCMENU");
} else if (page == "POSMON") {
canvas_mcdu.togglePageFreeze(i);
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -1075,6 +1087,8 @@ var rskbutton = func(btn, i) {
atsu.freeTexts[i].changed = 1;
} else if (page == "ATCMENU") {
pageNode[i].setValue("MCDUTEXT");
} else if (page == "VERTREV") {
canvas_mcdu.myVertRev[i].pushButtonRight(3);
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -1121,6 +1135,8 @@ var rskbutton = func(btn, i) {
}
}
pageNode[i].setValue("WINDCRZ");
} else if (find("PROG",page) != -1) {
progGENInput("R4",i);
} else if (page == "PERFTO") {
perfTOInput("R4",i);
} else if (page == "PERFAPPR") {
@ -1430,8 +1446,12 @@ var pagebutton = func(btn, i) {
pageNode[i].setValue("PROGCLB");
} else if (fmgc.FMGCInternal.phase == 3) {
pageNode[i].setValue("PROGCRZ");
} else if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
} else if (fmgc.FMGCInternal.phase == 4) {
pageNode[i].setValue("PROGDES");
} else if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
pageNode[i].setValue("PROGAPPR");
} else if (fmgc.FMGCInternal.phase == 7) {
pageNode[i].setValue("PROGDONE");
}
} else if (btn == "perf") {
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {

View file

@ -20,9 +20,10 @@ var perfTOCheckVSpeeds = func(i) {
}
var perfTOInput = func(key, i) {
var modifiable = (fmgc.FMGCInternal.phase == 1) ? 0 : 1;
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (fmgc.FMGCInternal.phase != 1) {
if (key == "L1" and modifiable) {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.v1 = 0;
fmgc.FMGCInternal.v1set = 0;
@ -49,11 +50,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (key == "L2") {
if (fmgc.FMGCInternal.phase != 1) {
} else if (key == "L2" and modifiable) {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.vr = 0;
fmgc.FMGCInternal.vrset = 0;
@ -74,11 +71,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (key == "L3") {
if (fmgc.FMGCInternal.phase != 1) {
} else if (key == "L3" and modifiable) {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.v2 = 0;
fmgc.FMGCInternal.v2set = 0;
@ -102,9 +95,6 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (key == "L4") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.transAlt = 18000;
@ -120,7 +110,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "L5") {
} else if (key == "L5" and modifiable) {
if (scratchpad == "CLR") {
setprop("/systems/thrust/clbreduc-ft", 1500);
setprop("/FMGC/internal/accel-agl-ft", 1500);
@ -160,7 +150,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R3") {
} else if (key == "R3" and modifiable) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/to-flap", 0);
setprop("/FMGC/internal/to-ths", "0.0");
@ -230,7 +220,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R4") {
} else if (key == "R4" and modifiable) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/flex", 0);
setprop("/FMGC/internal/flex-set", 0);
@ -251,7 +241,7 @@ var perfTOInput = func(key, i) {
mcdu_message(i, "NOT ALLOWED");
}
}
} else if (key == "R5") {
} else if (key == "R5" and modifiable) {
if (scratchpad == "CLR") {
setprop("/FMGC/internal/eng-out-reduc", "1500");
setprop("MCDUC/reducacc-set", 0);
@ -268,5 +258,7 @@ var perfTOInput = func(key, i) {
}
} else if (key == "R6") {
setprop("MCDU[" ~ i ~ "]/page", "PERFCLB");
} else {
mcdu_message(i, "NOT ALLOWED");
}
}

284
Nasal/MCDU/PROG.nas Normal file
View file

@ -0,0 +1,284 @@
# Copyright (c) 2020 Matthew Maring (mattmaring)
var altSet = props.globals.getNode("it-autoflight/input/alt", 1);
var brgDistResult = nil;
var progGENInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "R4") {
if (scratchpad == "CLR") {
bearingDistances[i].selectedPoint = nil;
bearingDistances[i].displayID = nil;
mcdu_scratchpad.scratchpads[i].empty();
} else {
brgDistResult = bearingDistances[i].newPoint(mcdu_scratchpad.scratchpads[i].scratchpad);
if (brgDistResult != 1) {
mcdu_message(i, "NOT IN DATA BASE");
} else {
mcdu_scratchpad.scratchpads[i].empty();
}
}
}
}
var progTOInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100 and fmgc.FMGCInternal.crzSet) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}
var progCLBInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}
var progCRZInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}
var progDESInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}
var _result = [nil, nil];
var _courseAndDistance = [nil, nil];
var bearingDistanceInstance = {
new: func(id) {
var bd = {parents: [bearingDistanceInstance]};
bd.id = id;
bd.bearing = 360;
bd.distance = 0;
bd.selectedPoint = nil;
bd.displayID = nil;
return bd;
},
newPointResult: func(result, duplicateNames = 0, duplicateNamesIndex = nil) {
if (duplicateNames != 0) {
me.selectedPoint = result[duplicateNamesIndex];
me.displayID = result[duplicateNamesIndex].id;
} elsif (size(result) > 1) {
if (canvas_mcdu.myDuplicate[me.id] != nil) {
canvas_mcdu.myDuplicate[me.id].del();
}
canvas_mcdu.myDuplicate[me.id] = nil;
canvas_mcdu.myDuplicate[me.id] = mcdu.duplicateNamesPage.new(result, 0, 0, me.id, 0, -999, -999, 1);
setprop("MCDU[" ~ me.id ~ "]/page", "DUPLICATENAMES");
} else {
me.selectedPoint = result[0];
me.displayID = result[0].id;
}
return 1;
},
newPointNavaid: func(result, duplicateNames = 0, duplicateNamesIndex = nil) {
if (duplicateNames != 0) {
me.selectedPoint = result[duplicateNamesIndex];
me.displayID = result[duplicateNamesIndex].id;
} elsif (size(result) > 1) {
if (canvas_mcdu.myDuplicate[me.id] != nil) {
canvas_mcdu.myDuplicate[me.id].del();
}
canvas_mcdu.myDuplicate[me.id] = nil;
canvas_mcdu.myDuplicate[me.id] = mcdu.duplicateNamesPage.new(result, 0, 1, me.id, 0, -999, -999, 1);
setprop("MCDU[" ~ me.id ~ "]/page", "DUPLICATENAMES");
} else {
me.selectedPoint = result[0];
me.displayID = result[0].id;
print("YES");
}
return 1;
},
newPointRWY: func(result,ID) {
if (size(result) > 1) {
#spawnPAGE
} else {
var string = split(left(ID,4),ID)[1];
if (find("C",string) != -1 or find("L",string) != -1 or find("R",string) != -1) {
if (size(string) == 2) {
string = "0" ~ string;
}
} else {
if (size(string) == 1) {
string = "0" ~ string;
}
}
if (contains(result[0].runways,string)) {
me.selectedPoint = {lat: result[0].runways[string].lat, lon: result[0].runways[string].lon};
me.displayID = left(ID,4) ~ string;
return 1;
} else {
return 0;
}
}
return 1;
},
newPointLatLon: func(result) {
return 0;
},
newPoint: func(id) {
_result[me.id] = fmgc.WaypointDatabase.getWP(id);
if (_result[me.id] != nil) {
me.selectedPoint = _result[me.id];
me.displayID = _result[me.id].id;
return 1;
}
if (size(id) >= 2 and size(id) <= 3) {
_result[me.id] = findNavaidsByID(id);
if (size(_result[me.id]) != 0) {
return me.newPointNavaid(_result[me.id]);
} else {
_result[me.id] = findAirportsByICAO(id); # consider 3 letter ICAOs
if (size(_result[me.id]) != 0) {
return me.newPointResult(_result[me.id]);
}
}
return 0;
} elsif (size(id) == 4) {
_result[me.id] = findAirportsByICAO(id);
if (size(_result[me.id]) != 0) {
return me.newPointResult(_result[me.id]);
} else {
_result[me.id] = findFixesByID(id);
if (size(_result[me.id]) != 0) {
return me.newPointResult(_result[me.id]);
}
}
return 0;
} elsif (size(id) >= 5 and size(id) <= 7) {
_result[me.id] = findFixesByID(id);
if (size(_result[me.id]) != 0) {
return me.newPointResult(_result[me.id]);
} else {
_result[me.id] = findAirportsByICAO(left(id,4));
if (size(_result[me.id]) != 0) {
return me.newPointRWY(_result[me.id],id);
}
}
return 0;
} elsif (size(id) >= 12) {
_result[me.id] = fetchLatLon(id);
if (size(_result[me.id]) != 0) {
return me.newPointLatLon(_result[me.id]);
}
return 0;
}
return 0;
},
update: func() {
if (me.selectedPoint == nil) {
return;
}
if (find("PROG",canvas_mcdu.pageProp[me.id].getValue()) == -1) {
return;
}
_courseAndDistance[me.id] = courseAndDistance(me.selectedPoint);
me.bearing = _courseAndDistance[me.id][0];
me.distance = _courseAndDistance[me.id][1];
},
};
var bearingDistances = [bearingDistanceInstance.new(0),bearingDistanceInstance.new(1)];
var BDTimer = maketimer(2, func(){
bearingDistances[0].update();
bearingDistances[1].update();
});
BDTimer.start();

View file

@ -1,33 +0,0 @@
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progCLBInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}

View file

@ -1,33 +0,0 @@
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progCRZInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 5) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}

View file

@ -1,33 +0,0 @@
# Copyright (c) 2020 Matthew Maring (mattmaring)
var progDESInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
if (fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
if (fmgc.FMGCInternal.phase == 4 or fmgc.FMGCInternal.phase == 5 or fmgc.FMGCInternal.phase == 6) {
fmgc.FMGCInternal.phase = 3;
setprop("/FMGC/internal/activate-once", 0);
setprop("/FMGC/internal/activate-twice", 0);
setprop("/FMGC/internal/decel", 0);
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}

View file

@ -1,23 +0,0 @@
# Copyright (c) 2020 Matthew Maring (mattmaring)
var altSet = props.globals.getNode("it-autoflight/input/alt", 1);
var progTOInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFl;
mcdu_scratchpad.scratchpads[i].empty();
} else if (int(scratchpad) != nil) {
var crzs = size(scratchpad);
if (crzs >= 1 and crzs <= 3 and scratchpad > 0 and scratchpad <= 430 and fmgc.FMGCInternal.crzSet <= scratchpad * 100 and fmgc.FMGCInternal.crzSet) {
fmgc.FMGCInternal.crzProg = scratchpad;
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_message(i, "NOT ALLOWED");
}
}
}

View file

@ -1,3 +1,5 @@
var scratchpadStore = nil;
var vertRev = {
title: [nil, nil, nil],
subtitle: [nil, nil],
@ -42,6 +44,28 @@ var vertRev = {
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
}
},
getSpd: func() {
if (me.wp.speed_cstr != nil and me.wp.speed_cstr > 0) {
var tcol = (me.wp.speed_cstr_type == "computed" or me.wp.speed_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
return [" " ~ sprintf("%3.0f", me.wp.speed_cstr), tcol];
} else {
return [nil,nil];
}
},
getAlt: func() {
if (me.wp.alt_cstr != nil and me.wp.alt_cstr > 0) {
var tcol = (me.wp.alt_cstr_type == "computed" or me.wp.alt_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
if (me.wp.alt_cstr > fmgc.FMGCInternal.transAlt) {
return [sprintf("%5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)) ~ " ", tcol];
} else {
return [sprintf("%5.0f", me.wp.alt_cstr) ~ " ", tcol];
}
} else {
return [nil,nil];
}
},
alt: nil,
speed: nil,
_setupPageWithData: func() {
if (me.type == 3) {
me.title = ["VERT REV", " AT ", "PPOS"];
@ -57,15 +81,30 @@ var vertRev = {
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
} elsif (me.type == 2) {
me.title = ["VERT REV", " AT ", me.id];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0]];
me.L1 = ["", " EFOB ---.-", "wht"];
me.R1 = ["", "EXTRA ---.- ", "wht"];
me.L2 = ["250/10000", " CLB SPD LIM", "mag"];
me.speed = me.getSpd();
if (me.speed[0] == nil) {
me.L3 = [" [ ]", " SPD CSTR", "blu"];
me.fontMatrix[0][2] = 1;
} else {
me.L3 = [me.speed[0], " SPD CSTR", me.speed[1]];
me.fontMatrix[0][2] = 0;
}
me.L4 = [" CONSTANT MACH", nil, "wht"];
me.L5 = [" WIND DATA", nil, "wht"];
me.L6 = [" CLB", nil, "amb"];
me.R2 = ["RTA ", nil, "wht"];
me.alt = me.getAlt();
if (me.alt[0] == nil) {
me.R3 = ["[ ] ", "ALT CSTR ", "blu"];
me.fontMatrix[1][2] = 1;
} else {
me.R3 = [me.alt[0], "ALT CSTR ", me.alt[1]];
me.fontMatrix[1][2] = 0;
}
me.R6 = ["DES ", nil, "amb"];
# When the system does vertical planning, L6 should be RETURN and R6 not used if the MCDU knows the waypoint is during climb or descent.
# The CLB or DES prompts should only be shown for a vertical revision in the cruise phase.
@ -74,7 +113,6 @@ var vertRev = {
# The 'arrows' for CLB/DES should actually be asterisks.
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 1, 0, 0, 0, 1]];
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "amb"], ["ack", "wht", "ack", "ack", "wht", "amb"]];
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0]];
} else {
me.title = ["VERT REV", " AT ", me.id];
@ -135,8 +173,22 @@ var vertRev = {
}
},
pushButtonLeft: func(index) {
if (index == 5) {
#print("role: ", me.wp.wp_role, ", type: ", me.wp.wp_type);
scratchpadStore = mcdu_scratchpad.scratchpads[me.computer].scratchpad;
if (index == 3 and me.type == 2) {
if (scratchpadStore == "CLR") {
me.wp.setSpeed("delete");
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} elsif (num(scratchpadStore) != nil and size(scratchpadStore) == 3 and scratchpadStore >= 100 and scratchpadStore <= 350) {
me.wp.setSpeed(scratchpadStore, "at");
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} else {
mcdu_message(me.computer, "FORMAT ERROR");
}
} elsif (index == 5) {
if (me.wp.wp_role == "sid") {
if (canvas_mcdu.myCLBWIND[me.computer] == nil) {
canvas_mcdu.myCLBWIND[me.computer] = windCLBPage.new(me.computer);
@ -182,6 +234,24 @@ var vertRev = {
mcdu_message(me.computer, "NOT ALLOWED");
}
},
pushButtonRight: func(index) {
scratchpadStore = mcdu_scratchpad.scratchpads[me.computer].scratchpad;
if (index == 3 and me.type == 2) {
if (scratchpadStore == "CLR") {
me.wp.setAltitude("delete");
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} elsif (num(scratchpadStore) != nil and (size(scratchpadStore) == 4 or size(scratchpadStore) == 5) and scratchpadStore >= 0 and scratchpadStore <= 39000) {
me.wp.setAltitude(math.round(scratchpadStore, 10), "at");
mcdu_scratchpad.scratchpads[me.computer].empty();
me._setupPageWithData();
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
} else {
mcdu_message(me.computer, "FORMAT ERROR");
}
}
},
};
var updateCrzLvlCallback = func () {

View file

@ -20,13 +20,12 @@ var Transponder = {
activeADIRS: 1,
condition: 0,
failed: 0,
codeDigitsNodes: [props.globals.getNode("instrumentation/transponder/inputs/digit[0]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[1]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[2]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[3]", 1)],
serviceableNode: props.globals.getNode("instrumentation/transponder/serviceable", 1),
knobNode: props.globals.getNode("instrumentation/transponder/inputs/knob-mode", 1),
identNode: props.globals.getNode("instrumentation/transponder/inputs/ident-btn", 1),
ac1Node: props.globals.getNode("/systems/electrical/bus/ac-1", 1),
tcasNode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
aglNode: props.globals.getNode("position/gear-agl-ft", 1),
codeDigitsNodes: [props.globals.getNode("/instrumentation/transponder/inputs/digit[0]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[1]", 1), props.globals.getNode("/instrumentation/transponder/inputs/digit[2]", 1), props.globals.getNode("instrumentation/transponder/inputs/digit[3]", 1)],
serviceableNode: props.globals.getNode("/instrumentation/transponder/serviceable", 1),
knobNode: props.globals.getNode("/instrumentation/transponder/inputs/knob-mode", 1),
identNode: props.globals.getNode("/instrumentation/transponder/inputs/ident-btn", 1),
tcasNode: props.globals.getNode("/instrumentation/tcas/inputs/mode"),
aglNode: props.globals.getNode("/position/gear-agl-ft", 1),
electricNode: props.globals.getNode("/systems/electrical/outputs/transponder", 1), # communicate to generic systems
new: func(elecSrc, ADIRS) {
var t = {parents:[Transponder]};
@ -40,9 +39,9 @@ var Transponder = {
return t;
},
update: func() {
update: func(notification) {
# TCAS - on seperate electrical source, so has to be before transponder electrical checking
if (me.ac1Node.getValue() < 110) {
if (notification.elecAC1 < 110) {
me.tcasNode.setValue(0); # off
} else {
if (me.mode >= 1 and me.mode <= 3) {
@ -285,7 +284,6 @@ var transponderPanel = {
var init = func() {
transponderPanel.atcSwitch(1);
transponderPanel.updateAirData();
transponderTimer.start();
}
# Handler for code change from generic dialog
@ -297,9 +295,6 @@ setlistener("/instrumentation/transponder/id-code", func {
var Transponders = std.Vector.new([Transponder.new("/systems/electrical/bus/ac-ess-shed", 1), Transponder.new("/systems/electrical/bus/ac-2", 2)]);
var transponderTimer = maketimer(0.1, func() {
Transponders.vector[transponderPanel.atcSel - 1].update();
});
setlistener("/systems/navigation/adr/operating-1", func() {
transponderPanel.updateADR1(systems.ADIRS.Operating.adr[0].getValue());

View file

@ -1,8 +1,10 @@
#
# Chrono - Clock - ET
# Chrono - Clock - ET
#
var chr = aircraft.timer.new("instrumentation/chrono[0]/elapsetime-sec",1);
var clk = aircraft.timer.new("instrumentation/clock/elapsetime-sec",1);
var chrono_cpt = aircraft.timer.new("instrumentation/ndchrono[0]/elapsetime-sec",1);
var chrono_fo = aircraft.timer.new("instrumentation/ndchrono[1]/elapsetime-sec",1);
var chr_min = nil;
var chr_sec = nil;
@ -49,6 +51,22 @@ var chrono = {
started: props.globals.getNode("/instrumentation/chrono[0]/started"),
};
#Cpt chrono
var cpt_chrono = {
etHh_cpt: props.globals.initNode("/instrumentation/ndchrono[0]/etHh_cpt", 0, "INT"),
etMin_cpt: props.globals.initNode("/instrumentation/ndchrono[0]/etMin_cpt", 0, "INT"),
etSec_cpt: props.globals.initNode("/instrumentation/ndchrono[0]/etSec_cpt", 0, "INT"),
text: props.globals.initNode("/instrumentation/ndchrono[0]/text", "0' 00''", "STRING"),
};
#Fo chrono
var fo_chrono = {
etHh_fo: props.globals.initNode("/instrumentation/ndchrono[1]/etHh_fo", 0, "INT"),
etMin_fo: props.globals.initNode("/instrumentation/ndchrono[1]/etMin_fo", 0, "INT"),
etSec_fo: props.globals.initNode("/instrumentation/ndchrono[1]/etSec_fo", 0, "INT"),
text: props.globals.initNode("/instrumentation/ndchrono[1]/text", "0' 00''", "STRING"),
};
var rudderTrim = {
rudderTrimDisplay: props.globals.initNode("/controls/flight/rudder-trim-display", 0, "STRING"),
rudderTrimDisplayLetter: props.globals.initNode("/controls/flight/rudder-trim-letter-display", "", "STRING"),
@ -59,6 +77,8 @@ setlistener("sim/signals/fdm-initialized", func {
chr.reset();
clk.stop();
clk.reset();
chrono_cpt.reset();
chrono_fo.reset();
rudderTrim.rudderTrimDisplay.setValue(sprintf("%2.1f", pts.Fdm.JSBsim.Hydraulics.Rudder.trimDeg.getValue()));
start_loop.start();
});
@ -120,6 +140,31 @@ setlistener("/instrumentation/chrono[0]/chrono-reset", func(et){
};
}, 0, 0);
#Chrono
setlistener("instrumentation/efis[0]/inputs/CHRONO", func(et){
chrono0 = et.getValue();
if (chrono0 == 1){
chrono_cpt.start();
} elsif (chrono0 == 2) {
chrono_cpt.stop();
} elsif (chrono0 == 0) {
chrono_cpt.reset();
setprop("instrumentation/ndchrono[0]/elapsetime-sec", 0);
}
}, 0, 0);
setlistener("instrumentation/efis[1]/inputs/CHRONO", func(et){
chrono1 = et.getValue();
if (chrono1 == 1){
chrono_fo.start();
} elsif (chrono1 == 2) {
chrono_fo.stop();
} elsif (chrono1 == 0) {
chrono_fo.reset();
setprop("instrumentation/ndchrono[1]/elapsetime-sec", 0);
}
}, 0, 0);
setlistener("instrumentation/clock/et-selector", func(et){
tmp1 = et.getValue();
if (tmp1 == 2){
@ -225,6 +270,40 @@ var start_loop = maketimer(0.1, func {
item.update(nil);
}
}
#Cpt Chrono
chr0_tmp = getprop("instrumentation/ndchrono[0]/elapsetime-sec");
if (chr0_tmp >= 360000) {
setprop("instrumentation/ndchrono[0]/elapsetime-sec", getprop("instrumentation/ndchrono[0]/elapsetime-sec") - 360000);
};
chr0_hh = int(chr0_tmp * 0.000277777777778);
chr0_min = int((chr0_tmp * 0.0166666666667) - (chr0_hh * 60));
chr0_sec = int(chr0_tmp - (chr0_min * 60) - (chr0_hh * 3600));
setprop("instrumentation/ndchrono[0]/etHh_cpt", chr0_hh);
setprop("instrumentation/ndchrono[0]/etMin_cpt", chr0_min);
setprop("instrumentation/ndchrono[0]/etSec_cpt", chr0_sec);
if (chr0_tmp >= 3600) {
setprop("instrumentation/ndchrono[0]/text", sprintf("%02d H %02d'", chr0_hh, chr0_min));
} else {
setprop("instrumentation/ndchrono[0]/text", sprintf("%02d' %02d''", chr0_min, chr0_sec));
}
#Fo Chrono
chr1_tmp = getprop("instrumentation/ndchrono[1]/elapsetime-sec");
if (chr1_tmp >= 360000) {
setprop("instrumentation/ndchrono[1]/elapsetime-sec", getprop("instrumentation/ndchrono[1]/elapsetime-sec") - 360000);
};
chr1_hh = int(chr1_tmp * 0.000277777777778);
chr1_min = int(chr1_tmp * 0.0166666666667);
chr1_sec = int(chr1_tmp - (chr1_min * 60) - (chr1_hh * 3600));
setprop("instrumentation/ndchrono[1]/etHh_fo", chr1_hh);
setprop("instrumentation/ndchrono[1]/etMin_fo", chr1_min);
setprop("instrumentation/ndchrono[1]/etSec_fo", chr1_sec);
if (chr1_tmp >= 3600) {
setprop("instrumentation/ndchrono[1]/text", sprintf("%02d H %02d'", chr1_hh, chr1_min));
} else {
setprop("instrumentation/ndchrono[1]/text", sprintf("%02d' %02d''", chr1_min, chr1_sec));
}
});
var updateRudderTrim = func() {

View file

@ -96,6 +96,9 @@ var am_mode_rmp3 = props.globals.initNode("/systems/radio/rmp[2]/am-active", 0,
var sel_crs_rmp1 = props.globals.initNode("/systems/radio/rmp[0]/select-crs", 1, "BOOL");
var sel_crs_rmp2 = props.globals.initNode("/systems/radio/rmp[1]/select-crs", 1, "BOOL");
var vhf3_data_mode = props.globals.initNode("/systems/radio/vhf3-data-mode", 1, "BOOL");
var data_mode_stby_rmp = props.globals.initNode("/systems/radio/data-mode-stby-rmp", 0, "INT");
var init = func() {
chan_rmp1.setValue("vhf1");
chan_rmp2.setValue("vhf2");
@ -153,7 +156,6 @@ var update_active_vhf = func(vhf) {
var sel3 = chan_rmp3.getValue();
if (vhf == 1) {
if (sel1 == "vhf1" or sel2 == "vhf1") {
var act = sprintf("%3.3f", act_vhf1.getValue());
if (sel1 == "vhf1") {
@ -165,9 +167,7 @@ var update_active_vhf = func(vhf) {
if (sel3 == "vhf1") {
act_display_rmp3.setValue(act);
}
}
} else if (vhf == 2) {
if (sel1 == "vhf2" or sel2 == "vhf2") {
var act = sprintf("%3.3f", act_vhf2.getValue());
if (sel1 == "vhf2") {
@ -179,33 +179,31 @@ var update_active_vhf = func(vhf) {
if (sel3 == "vhf2") {
act_display_rmp3.setValue(act);
}
}
} else if (vhf == 3) {
if (sel1 == "vhf3" or sel2 == "vhf3") {
var act = sprintf("%3.3f", act_vhf3.getValue());
var data_mode = vhf3_data_mode.getValue();
if (sel1 == "vhf3") {
if (act == 0) {
if (data_mode == 1) {
act_display_rmp1.setValue("data");
} else {
act_display_rmp1.setValue(act);
}
}
if (sel2 == "vhf3") {
if (act == 0) {
if (data_mode == 1) {
act_display_rmp2.setValue("data");
} else {
act_display_rmp2.setValue(act);
}
}
if (sel3 == "vhf3") {
if (act == 0) {
if (data_mode == 1) {
act_display_rmp3.setValue("data");
} else {
act_display_rmp3.setValue(act);
}
}
}
} else if (vhf == 4) {
if (sel1 == "hf1" or sel2 == "hf1") {
var act = sprintf("%5.0f", systems.HFS[0].selectedChannelKhz);
@ -283,6 +281,7 @@ var update_displays_nav = func(nav) {
}
var update_stby_freq = func(rmp_no, freq) {
var data_mode = vhf3_data_mode.getValue();
if (rmp_no == 0) {
if (freq == 1) {
var stby = sprintf("%3.3f", stby_rmp1_vhf1.getValue());
@ -296,7 +295,7 @@ var update_stby_freq = func(rmp_no, freq) {
var stby = sprintf("%5.0f", stby_rmp1_hf2.getValue());
}
if (stby == 0) {
if (data_mode == 0 and data_mode_stby_rmp.getValue() == 0) {
stby_display_rmp1.setValue("data");
} else {
stby_display_rmp1.setValue(stby);
@ -314,7 +313,7 @@ var update_stby_freq = func(rmp_no, freq) {
var stby = sprintf("%5.0f", stby_rmp2_hf2.getValue());
}
if (stby == 0) {
if (data_mode == 0 and data_mode_stby_rmp.getValue() == 1) {
stby_display_rmp2.setValue("data");
} else {
stby_display_rmp2.setValue(stby);
@ -332,7 +331,7 @@ var update_stby_freq = func(rmp_no, freq) {
var stby = sprintf("%5.0f", stby_rmp3_hf2.getValue());
}
if (stby == 0) {
if (data_mode == 0 and data_mode_stby_rmp.getValue() == 2) {
stby_display_rmp3.setValue("data");
} else {
stby_display_rmp3.setValue(stby);
@ -399,6 +398,18 @@ var transfer = func(rmp_no) {
var sel_crs = getprop("/systems/radio/rmp[" ~ rmp_no ~ "]/select-crs");
if (string.match(sel_chan, "vhf[1-3]")) {
var data_mode = vhf3_data_mode.getValue();
if (string.match(sel_chan, "vhf3") and ((data_mode_stby_rmp.getValue() == rmp_no and data_mode == 0) or data_mode == 1)) {
if (data_mode == 0)
{
vhf3_data_mode.setValue(1);
}
else
{
vhf3_data_mode.setValue(0);
data_mode_stby_rmp.setValue(rmp_no);
}
}
var mod1 = int(string.replace(sel_chan, "vhf", ""));
var mod = mod1 - 1;

View file

@ -144,6 +144,7 @@ var ADIRU = {
call(canvas_nd.ND_2.NDFo.predicates[predicate]);
}
},
_excessMotion: 0,
alignLoop: func() {
me._roll = pts.Orientation.roll.getValue();
me._pitch = pts.Orientation.pitch.getValue();
@ -152,13 +153,18 @@ var ADIRU = {
# todo use IR values
if (me._gs > 5 or abs(me._pitch) > 5 or abs(me._roll) > 10) {
me.stopAlignNoAlign();
me._excessMotion = 1;
print("Excessive motion, restarting");
me.update(); # update operative
me.align(calcAlignTime(pts.Position.latitude.getValue()));
} elsif (me.operative == 0) {
me.stopAlignNoAlign();
me._excessMotion = 0;
} elsif (pts.Sim.Time.elapsedSec.getValue() >= me._alignTime) {
me.stopAlignAligned();
me._excessMotion = 0;
} else {
me._excessMotion = 0;
}
if (!me.operating and pts.Sim.Time.elapsedSec.getValue() >= me._pfdTime) {
@ -318,7 +324,7 @@ var ADIRS = {
}
),
],
loop: func() {
loop: func(notification) {
if (me._init) {
for (i = 0; i < _NUMADIRU; i = i + 1) {
# update ADR units power
@ -342,7 +348,6 @@ var ADIRS = {
}
# Update VFE
notification = nil;
foreach (var update_item; me.update_items) {
update_item.update(notification);
}

View file

@ -111,7 +111,7 @@ var BrakeSystem =
},
# update brake energy
update : func()
update : func(notification)
{
if (me.counter == 0) {
me.counter = 1;
@ -122,10 +122,10 @@ var BrakeSystem =
LThermalEnergy = me.thermalEnergy[0];
RThermalEnergy = me.thermalEnergy[1];
me.CurrentTime = pts.Sim.Time.elapsedSec.getValue();
me.CurrentTime = notification.elapsedTime;
dt = me.CurrentTime - me.LastSimTime;
LBrakeLevel = pts.Fdm.JSBsim.Fcs.brake[0].getValue();
RBrakeLevel = pts.Fdm.JSBsim.Fcs.brake[1].getValue();
LBrakeLevel = notification.leftBrakeFCS;
RBrakeLevel = notification.rightBrakeFCS;
tatdegc = pts.Fdm.JSBsim.Propulsion.tatC.getValue() or 0;
if (pts.Sim.replayState.getValue() == 0 and dt < 1.0) {
@ -137,7 +137,7 @@ var BrakeSystem =
LCoolingRatio = LCoolingRatio * 3;
RCoolingRatio = RCoolingRatio * 3;
};
airspeed = pts.Velocities.airspeed.getValue();
airspeed = notification.airspeedV;
if (pts.Gear.position[1].getValue()) {
#increase CoolingRatio if gear down according to airspeed
LCoolingRatio = LCoolingRatio * airspeed;
@ -168,7 +168,7 @@ var BrakeSystem =
L_Thrust = 0;
R_Thrust = 0;
if (pts.Gear.wow[1].getValue()) {
if (notification.gear1Wow) {
var V1 = pts.Velocities.groundspeed.getValue();
var Mass = pts.Fdm.JSBsim.Inertia.weightLbs.getValue() * me.ScalingDivisor;
@ -179,7 +179,7 @@ var BrakeSystem =
LThermalEnergy += (Mass * pts.Gear.compression[1].getValue() * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2);
if (pts.Controls.Gear.chocks.getValue()) {
if (!pts.Controls.Gear.parkingBrake.getValue()) {
if (!notification.parkingBrake) {
# cooling effect: reduce thermal energy by (LnCoolFactor) * dt
LThermalEnergy = LThermalEnergy * math.exp(LnCoolFactor * dt);
} else {
@ -188,7 +188,7 @@ var BrakeSystem =
LThermalEnergy = (LThermalEnergy * math.exp(LnCoolFactor * dt)) + (L_Thrust * dt);
};
} else {
if (!pts.Controls.Gear.parkingBrake.getValue()) {
if (!notification.parkingBrake) {
if (LBrakeLevel>0) {
if (V2_L>0) {
#LThermalEnergy += (Mass * (math.pow(V1, 2) - math.pow(V2_L, 2)) / 2) + L_thrust;
@ -212,7 +212,7 @@ var BrakeSystem =
RThermalEnergy += (Mass * pts.Gear.compression[2].getValue() * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2);
if (pts.Controls.Gear.chocks.getValue()) {
if (!pts.Controls.Gear.parkingBrake.getValue()) {
if (!notification.parkingBrake) {
# cooling effect: reduce thermal energy by (RnCoolFactor) * dt
RThermalEnergy = RThermalEnergy * math.exp(RnCoolFactor * dt);
} else {
@ -221,7 +221,7 @@ var BrakeSystem =
RThermalEnergy = (RThermalEnergy * math.exp(RnCoolFactor * dt)) + (R_Thrust * dt);
};
} else {
if (!pts.Controls.Gear.parkingBrake.getValue()) {
if (!notification.parkingBrake) {
if (RBrakeLevel>0) {
if (V2_R>0) {
#RThermalEnergy += (Mass * (math.pow(V1, 2) - math.pow(V2_R, 2)) / 2) + R_thrust;
@ -271,7 +271,7 @@ var BrakeSystem =
if (LThermalEnergy>1 and !me.LSmokeActive) {
# start smoke processing
me.LSmokeActive = 1;
settimer(func { BrakeSys.Lsmoke(); },0);
settimer(func { BrakeSys.Lsmoke(); },0); # is settimer needed?
};
if (RThermalEnergy>1 and !me.RSmokeActive) {
# start smoke processing
@ -406,7 +406,7 @@ var Autobrake = {
me._mode = me.mode.getValue();
me._active = me.active.getBoolValue();
if (me._gnd_speed > 72) {
if (me._mode != 0 and pts.Controls.Engines.Engine.throttle[0].getValue() < 0.15 and pts.Controls.Engines.Engine.throttle[1].getValue() < 0.15 and me._wow0 and systems.HYD.Brakes.askidSw.getValue() and systems.HYD.Psi.green.getValue() >= 2500 ) {
if (me._mode != 0 and pts.Controls.Engines.Engine.throttle[0].getValue() < 0.15 and pts.Controls.Engines.Engine.throttle[1].getValue() < 0.15 and me._wow0 and systems.HYD.Switch.nwsSwitch.getBoolValue() and systems.HYD.Psi.green.getValue() >= 2500 ) {
me.active.setBoolValue(1);
} elsif (me._active) {
me.active.setBoolValue(0);

View file

@ -13,8 +13,6 @@ var dc2 = 0;
# Main class
var ELEC = {
_timer1On: 0,
_timer2On: 0,
EmerElec: props.globals.getNode("/systems/electrical/some-electric-thingie/emer-elec-config"),
Bus: {
acEss: props.globals.getNode("/systems/electrical/bus/ac-ess"),
@ -122,6 +120,7 @@ var ELEC = {
volts: props.globals.getNode("/systems/electrical/sources/emer-gen/output-volt"),
hertz: props.globals.getNode("/systems/electrical/sources/emer-gen/output-hertz"),
voltsRelay: props.globals.getNode("/systems/electrical/relay/emer-glc/output"),
relayPos: props.globals.getNode("/systems/electrical/relay/emer-glc/contact-pos"),
},
Ext: {
volts: props.globals.getNode("/systems/electrical/sources/ext/output-volt"),
@ -207,36 +206,65 @@ var ELEC = {
me.Fail.tr1Fault.setBoolValue(0);
me.Fail.tr2Fault.setBoolValue(0);
},
loop: func() {
_FMGC1: 0,
_FMGC2: 0,
_activeFMGC: nil,
_timer1On: 0,
_timer2On: 0,
loop: func(notification) {
# Autopilot Disconnection routines
if (me.Bus.dcEssShed.getValue() < 25) {
if (fmgc.Output.ap1.getValue() and !me._timer1On) {
me._activeFMGC = fcu.FCUController.activeFMGC.getValue();
me._FMGC1 = fmgc.Output.ap1.getValue();
me._FMGC2 = fmgc.Output.ap2.getValue();
if (notification.dcEssShed < 25) {
if (me._FMGC1 and !me._timer1On) { # delay 1 cycle to avoid spurious
me._timer1On = 1;
settimer(func() {
if (me.Bus.dcEssShed.getValue() < 25) {
} elsif (me._FMGC1) {
if (notification.dcEssShed < 25) {
fcu.apOff("hard", 1);
if (fcu.FCUController.activeFMGC.getValue() == 1) {
if (me._activeFMGC == 1) {
fcu.athrOff("hard");
}
}
me._timer1On = 0;
}, 0.1);
}
}
if (me.Bus.dc2.getValue() < 25) {
if (fmgc.Output.ap2.getValue() and !me._timer2On) {
if (notification.dc2 < 25) {
if (me._FMGC2 and !me._timer2On) { # delay 1 cycle to avoid spurious
me._timer2On = 1;
settimer(func() {
if (me.Bus.dc2.getValue() < 25) {
} elsif (me._FMGC2) {
if (notification.dc2 < 25) {
fcu.apOff("hard", 2);
if (fcu.FCUController.activeFMGC.getValue() == 2) {
if (me._activeFMGC == 2) {
fcu.athrOff("hard");
}
}
me._timer2On = 0;
}, 0.1);
}
}
},
};
# Emesary
var A320Electrical = notifications.SystemRecipient.new("A320 Electrical",ELEC.loop,ELEC);
emesary.GlobalTransmitter.Register(A320Electrical);
var input = {
"elecAC1": "/systems/electrical/bus/ac-1",
"elecAC2": "/systems/electrical/bus/ac-2",
"elecACEss": "/systems/electrical/bus/ac-ess",
"elecACEssShed": "/systems/electrical/bus/ac-ess-shed",
"dc1": "/systems/electrical/bus/dc-1",
"dc2": "/systems/electrical/bus/dc-2",
"dcBat": "/systems/electrical/bus/dc-bat",
"dcEss": "/systems/electrical/bus/dc-ess",
"dcEssShed": "/systems/electrical/bus/dc-ess-shed",
"dcHot1": "/systems/electrical/bus/dc-hot-1",
"dcHot2": "/systems/electrical/bus/dc-hot-2",
};
foreach (var name; keys(input)) {
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Electrical", name, input[name]));
}

View file

@ -17,6 +17,7 @@ var cargoTestBtnOff = props.globals.initNode("/controls/fire/cargo/test-off", 0,
var eng1FireWarn = props.globals.initNode("/systems/fire/engine1/warning-active", 0, "BOOL");
var eng2FireWarn = props.globals.initNode("/systems/fire/engine2/warning-active", 0, "BOOL");
var apuFireWarn = props.globals.initNode("/systems/fire/apu/warning-active", 0, "BOOL");
var lavatoryFireWarn = props.globals.getNode("/systems/fire/lavatory/warning", 1);
var eng1Inop = props.globals.initNode("/systems/fire/engine1/det-inop", 0, "BOOL");
var eng2Inop = props.globals.initNode("/systems/fire/engine2/det-inop", 0, "BOOL");
var apuInop = props.globals.initNode("/systems/fire/apu/det-inop", 0, "BOOL");
@ -33,13 +34,15 @@ var eng1Agent2TimerTime = props.globals.initNode("/systems/fire/engine1/agent2-t
var eng2Agent2TimerTime = props.globals.initNode("/systems/fire/engine2/agent2-timer-time", 0, "INT");
var apuAgentTimerTime = props.globals.initNode("/systems/fire/apu/agent-timer-time", 0, "INT");
var fireButtons = [props.globals.getNode("/controls/engines/engine[0]/fire-btn"),props.globals.getNode("/controls/engines/engine[1]/fire-btn"),props.globals.getNode("/controls/apu/fire-btn")];
var fire_init = func {
setprop("/controls/OH/protectors/fwddisch", 0);
setprop("/controls/OH/protectors/aftdisch", 0);
setprop("/controls/fire/cargo/fwddisch", 0);
setprop("/controls/fire/cargo/aftdisch", 0);
setprop("/systems/failures/cargo-fwd-fire", 0);
setprop("/systems/failures/cargo-aft-fire", 0);
setprop("/systems/failures/fire/cargo-fwd-fire", 0);
setprop("/systems/failures/fire/cargo-aft-fire", 0);
setprop("/controls/fire/cargo/test", 0);
fire_timer.start();
}
@ -276,9 +279,9 @@ var detectorLoop = {
}
},
sendSignal: func(system, typeLoop) {
if (system == 0 and !getprop("/systems/failures/engine-left-fire")) { return; }
elsif (system == 1 and !getprop("/systems/failures/engine-right-fire")) { return; }
elsif (system == 2 and !getprop("/systems/failures/apu-fire")) { return; }
if (system == 0 and !getprop("/systems/failures/fire/engine-left-fire")) { return; }
elsif (system == 1 and !getprop("/systems/failures/fire/engine-right-fire")) { return; }
elsif (system == 2 and !getprop("/systems/failures/fire/apu-fire")) { return; }
engFireDetectorUnits.vector[system].receiveSignal(typeLoop);
}
};
@ -303,8 +306,8 @@ var cargoDetectorLoop = {
}
},
sendSignal: func(system, typeLoop) {
if ((system == 0 or system == 1) and !getprop("/systems/failures/cargo-aft-fire")) { return; }
elsif (system == 2 and !getprop("/systems/failures/cargo-fwd-fire")) { return; }
if ((system == 0 or system == 1) and !getprop("/systems/failures/fire/cargo-aft-fire")) { return; }
elsif (system == 2 and !getprop("/systems/failures/fire/cargo-fwd-fire")) { return; }
cargoSmokeDetectorUnits.vector[system].receiveSignal(typeLoop);
}
@ -488,29 +491,29 @@ var checkTwoInop2Timer = maketimer(0.1, checkTwoInop2);
var checkTwoInop3Timer = maketimer(0.1, checkTwoInop3);
# Create fire systems
var engFireDetectorUnits = std.Vector.new([ engFireDetectorUnit.new(0, "/systems/failures/engine-left-fire", "/controls/fire/test-btn-1"), engFireDetectorUnit.new(1, "/systems/failures/engine-right-fire", "/controls/fire/test-btn-2"), engFireDetectorUnit.new(2, "/systems/failures/apu-fire", "/controls/fire/apu-test-btn") ]);
var cargoSmokeDetectorUnits = std.Vector.new([cargoSmokeDetectorUnit.new(0, "/systems/failures/cargo-aft-fire"), cargoSmokeDetectorUnit.new(1, "/systems/failures/cargo-aft-fire"), cargoSmokeDetectorUnit.new(1, "/systems/failures/cargo-fwd-fire")]);
var engFireDetectorUnits = std.Vector.new([ engFireDetectorUnit.new(0, "/systems/failures/fire/engine-left-fire", "/controls/fire/test-btn-1"), engFireDetectorUnit.new(1, "/systems/failures/fire/engine-right-fire", "/controls/fire/test-btn-2"), engFireDetectorUnit.new(2, "/systems/failures/fire/apu-fire", "/controls/fire/apu-test-btn") ]);
var cargoSmokeDetectorUnits = std.Vector.new([cargoSmokeDetectorUnit.new(0, "/systems/failures/fire/cargo-aft-fire"), cargoSmokeDetectorUnit.new(1, "/systems/failures/fire/cargo-aft-fire"), cargoSmokeDetectorUnit.new(1, "/systems/failures/fire/cargo-fwd-fire")]);
# Create detector loops
var engDetectorLoops = std.Vector.new([
detectorLoop.new(0, 1, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc-ess", "/systems/failures/engine-left-fire"), detectorLoop.new(0, 2, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc-2", "/systems/failures/engine-left-fire"),
detectorLoop.new(1, 1, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc-2", "/systems/failures/engine-right-fire"), detectorLoop.new(1, 2, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc-ess", "/systems/failures/engine-right-fire"),
detectorLoop.new(2, 1, "/systems/fire/apu/temperature", "/systems/electrical/bus/dc-bat", "/systems/failures/apu-fire"), detectorLoop.new(2, 2, "/systems/fire/apu/temperature", "/systems/electrical/bus/dc-bat", "/systems/failures/apu-fire")
detectorLoop.new(0, 1, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc-ess", "/systems/failures/fire/engine-left-fire"), detectorLoop.new(0, 2, "/systems/fire/engine1/temperature", "/systems/electrical/bus/dc-2", "/systems/failures/fire/engine-left-fire"),
detectorLoop.new(1, 1, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc-2", "/systems/failures/fire/engine-right-fire"), detectorLoop.new(1, 2, "/systems/fire/engine2/temperature", "/systems/electrical/bus/dc-ess", "/systems/failures/fire/engine-right-fire"),
detectorLoop.new(2, 1, "/systems/fire/apu/temperature", "/systems/electrical/bus/dc-bat", "/systems/failures/fire/apu-fire"), detectorLoop.new(2, 2, "/systems/fire/apu/temperature", "/systems/electrical/bus/dc-bat", "/systems/failures/fire/apu-fire")
]);
var cargoDetectorLoops = std.Vector.new([
cargoDetectorLoop.new(0, 1, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"), cargoDetectorLoop.new(0, 2, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"),
cargoDetectorLoop.new(1, 1, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"), cargoDetectorLoop.new(1, 2, "/systems/fire/cargo/aft/temperature", "/systems/failures/cargo-aft-fire"),
cargoDetectorLoop.new(2, 1, "/systems/fire/cargo/fwd/temperature", "/systems/failures/cargo-fwd-fire"), cargoDetectorLoop.new(2, 2, "/systems/fire/cargo/fwd/temperature", "/systems/failures/cargo-fwd-fire")
cargoDetectorLoop.new(0, 1, "/systems/fire/cargo/aft/temperature", "/systems/failures/fire/cargo-aft-fire"), cargoDetectorLoop.new(0, 2, "/systems/fire/cargo/aft/temperature", "/systems/failures/fire/cargo-aft-fire"),
cargoDetectorLoop.new(1, 1, "/systems/fire/cargo/aft/temperature", "/systems/failures/fire/cargo-aft-fire"), cargoDetectorLoop.new(1, 2, "/systems/fire/cargo/aft/temperature", "/systems/failures/fire/cargo-aft-fire"),
cargoDetectorLoop.new(2, 1, "/systems/fire/cargo/fwd/temperature", "/systems/failures/fire/cargo-fwd-fire"), cargoDetectorLoop.new(2, 2, "/systems/fire/cargo/fwd/temperature", "/systems/failures/fire/cargo-fwd-fire")
]);
# Create extinguisher bottles
var extinguisherBottles = std.Vector.new([extinguisherBottle.new(0, "/systems/fire/engine1/disch1", "/systems/electrical/bus/dc-hot-1", "/systems/failures/engine-left-fire", "/systems/fire/engine1/warning-active"), extinguisherBottle.new(1, "/systems/fire/engine1/disch2", "/systems/electrical/bus/dc-2", "/systems/failures/engine-left-fire", "/systems/fire/engine1/warning-active"),
extinguisherBottle.new(0, "/systems/fire/engine2/disch1", "/systems/electrical/bus/dc-hot-2", "/systems/failures/engine-right-fire", "/systems/fire/engine2/warning-active"), extinguisherBottle.new(1, "/systems/fire/engine2/disch2", "/systems/electrical/bus/dc-2", "/systems/failures/engine-right-fire", "/systems/fire/engine2/warning-active"),
extinguisherBottle.new(9, "/systems/fire/apu/disch", "/systems/electrical/bus/dc-bat", "/systems/failures/apu-fire", "/systems/fire/apu/warning-active") ]);
var extinguisherBottles = std.Vector.new([extinguisherBottle.new(0, "/systems/fire/engine1/disch1", "/systems/electrical/bus/dc-hot-1", "/systems/failures/fire/engine-left-fire", "/systems/fire/engine1/warning-active"), extinguisherBottle.new(1, "/systems/fire/engine1/disch2", "/systems/electrical/bus/dc-2", "/systems/failures/fire/engine-left-fire", "/systems/fire/engine1/warning-active"),
extinguisherBottle.new(0, "/systems/fire/engine2/disch1", "/systems/electrical/bus/dc-hot-2", "/systems/failures/fire/engine-right-fire", "/systems/fire/engine2/warning-active"), extinguisherBottle.new(1, "/systems/fire/engine2/disch2", "/systems/electrical/bus/dc-2", "/systems/failures/fire/engine-right-fire", "/systems/fire/engine2/warning-active"),
extinguisherBottle.new(9, "/systems/fire/apu/disch", "/systems/electrical/bus/dc-bat", "/systems/failures/fire/apu-fire", "/systems/fire/apu/warning-active") ]);
# There is only one bottle but the system will think there are two, so other parts work
var cargoExtinguisherBottles = std.Vector.new([extinguisherBottle.new(8, "/systems/fire/cargo/disch", "/systems/electrical/bus/dc-bat", "/systems/failures/cargo-aft-fire", "/systems/fire/cargo/aft/warning-active", 250), extinguisherBottle.new(7, "/systems/fire/cargo/disch", "/systems/electrical/bus/dc-bat", "/systems/failures/cargo-fwd-fire", "/systems/fire/cargo/fwd/warning-active", 250)]);
var cargoExtinguisherBottles = std.Vector.new([extinguisherBottle.new(8, "/systems/fire/cargo/disch", "/systems/electrical/bus/dc-bat", "/systems/failures/fire/cargo-aft-fire", "/systems/fire/cargo/aft/warning-active", 250), extinguisherBottle.new(7, "/systems/fire/cargo/disch", "/systems/electrical/bus/dc-bat", "/systems/failures/fire/cargo-fwd-fire", "/systems/fire/cargo/fwd/warning-active", 250)]);
# Create CIDS channels
var CIDSchannels = std.Vector.new([CIDSchannel.new("/systems/electrical/bus/dc-ess"), CIDSchannel.new("/systems/electrical/bus/dc-2")]);
@ -544,7 +547,7 @@ var createCargoFireBottleListener = func(prop, index) {
# Listeners
setlistener("/controls/engines/engine[0]/fire-btn", func() {
if (getprop("/controls/engines/engine[0]/fire-btn") == 1) {
if (systems.fireButtons[0].getValue() == 1) {
ecam.shutUpYou();
eng1AgentTimerMakeTimer.stop();
eng1AgentTimer.setValue(10);
@ -587,7 +590,7 @@ eng1Agent2TimerMakeTimerFunc = func() {
}
setlistener("/controls/engines/engine[1]/fire-btn", func() {
if (getprop("/controls/engines/engine[1]/fire-btn") == 1) {
if (systems.fireButtons[1].getValue() == 1) {
ecam.shutUpYou();
eng2AgentTimerMakeTimer.stop();
eng2AgentTimer.setValue(10);
@ -652,7 +655,7 @@ apuAgentTimerMakeTimerFunc = func() {
}
setlistener("/controls/fire/test-btn-1", func() {
if (getprop("/systems/failures/engine-left-fire")) { return; }
if (getprop("/systems/failures/fire/engine-left-fire")) { return; }
if (testBtn.getValue() == 1) {
if (systems.ELEC.Bus.dcBat.getValue() > 25 or systems.ELEC.Bus.dcEss.getValue() > 25) {
@ -665,7 +668,7 @@ setlistener("/controls/fire/test-btn-1", func() {
}, 0, 0);
setlistener("/controls/fire/test-btn-2", func() {
if (getprop("/systems/failures/engine-right-fire")) { return; }
if (getprop("/systems/failures/fire/engine-right-fire")) { return; }
if (testBtn2.getValue() == 1) {
if (systems.ELEC.Bus.dcBat.getValue() > 25 or systems.ELEC.Bus.dcEss.getValue() > 25) {
eng2FireWarn.setBoolValue(1);
@ -677,7 +680,7 @@ setlistener("/controls/fire/test-btn-2", func() {
}, 0, 0);
setlistener("/controls/fire/apu-test-btn", func() {
if (getprop("/systems/failures/apu-fire")) { return; }
if (getprop("/systems/failures/fire/apu-fire")) { return; }
if (apuTestBtn.getValue() == 1) {
if (systems.ELEC.Bus.dcBat.getValue() > 25 or systems.ELEC.Bus.dcEss.getValue() > 25) {
apuFireWarn.setBoolValue(1);
@ -689,7 +692,7 @@ setlistener("/controls/fire/apu-test-btn", func() {
}, 0, 0);
setlistener("/controls/fire/cargo/test", func() {
if (getprop("/systems/failures/aft-cargo-fire") or getprop("/systems/failures/fwd-cargo-fire") or systems.ELEC.Bus.dcBat.getValue() < 25 or systems.ELEC.Bus.dcEss.getValue() < 25) { return; }
if (getprop("/systems/failures/fire/aft-cargo-fire") or getprop("/systems/failures/fire/fwd-cargo-fire") or systems.ELEC.Bus.dcBat.getValue() < 25 or systems.ELEC.Bus.dcEss.getValue() < 25) { return; }
if (cargoTestBtn.getBoolValue()) {
cargoTestTime.setValue(elapsedTime.getValue());
cargoTestChecker.start();

View file

@ -10,7 +10,6 @@ var HYD = {
accumPressPsi: props.globals.initNode("/systems/hydraulic/yellow-accumulator-psi-cmd", 0, "INT"),
leftPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-left-psi", 0, "INT"),
rightPressPsi: props.globals.initNode("/systems/hydraulic/brakes/pressure-right-psi", 0, "INT"),
askidSw: props.globals.initNode("/systems/hydraulic/brakes/askidnwssw", 1, "BOOL"),
mode: props.globals.initNode("/systems/hydraulic/brakes/mode", 0, "INT"),
leftbrake: props.globals.getNode("/controls/gear/brake-left"),
rightbrake: props.globals.getNode("/controls/gear/brake-right"),
@ -57,6 +56,7 @@ var HYD = {
rat: props.globals.getNode("/controls/hydraulic/switches/rat-man"),
yellowEDP: props.globals.getNode("/controls/hydraulic/switches/yellow-edp"),
yellowElec: props.globals.getNode("/controls/hydraulic/switches/yellow-elec"),
nwsSwitch: props.globals.getNode("/controls/gear/nws-switch"),
},
Valve: {
yellowFire: props.globals.getNode("/systems/hydraulic/sources/yellow-edp/fire-valve"),
@ -85,97 +85,91 @@ var HYD = {
me.Fail.yellowElec.setBoolValue(0);
me.Fail.yellowLeak.setBoolValue(0);
},
loop: func() {
if (props.globals.getValue("/controls/gear/nws-switch") == 1) {
me.Brakes.askidSw.setBoolValue(1); #true
} else {
me.Brakes.askidSw.setBoolValue(0); #false
}
loop: func(notification) {
# Decrease accumPressPsi when green and yellow hydraulic's aren't pressurized
if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
if (me.Brakes.leftbrake.getValue() > 0 or notification.brakesMode == 0) {
lcont = lcont + 1;
} else {
lcont = 0;
}
if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
if (me.Brakes.rightbrake.getValue() > 0 or notification.brakesMode == 0) {
rcont = rcont + 1;
} else {
rcont = 0;
}
if (me.Psi.yellow.getValue() < me.Brakes.accumPressPsi.getValue() and me.Brakes.accumPressPsi.getValue() > 0) {
if (notification.yellow < notification.accumPressPsi and notification.accumPressPsi > 0) {
if (lcont == 1) {
me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - 200);
me.Brakes.accumPressPsi.setValue(notification.accumPressPsi - 200);
}
if (rcont == 1) {
me.Brakes.accumPressPsi.setValue(me.Brakes.accumPressPsi.getValue() - 200);
me.Brakes.accumPressPsi.setValue(notification.accumPressPsi - 200);
}
if (me.Brakes.accumPressPsi.getValue() < 0) {
if (notification.accumPressPsi < 0) {
me.Brakes.accumPressPsi.setValue(0);
}
}
# Braking Pressure
if (me.Brakes.mode.getValue() == 1 or (me.Brakes.mode.getValue() == 2 and me.Psi.green.getValue() >= 2500)) {
if (notification.brakesMode == 1 or (notification.brakesMode == 2 and notification.green >= 2500)) {
# Normal braking - Green OK
if (me.Brakes.leftbrake.getValue() > 0) {
me.Brakes.leftPressPsi.setValue(me.Psi.green.getValue() * pts.Fdm.JSBsim.Fcs.brake[0].getValue());
if (notification.leftBrake > 0) {
me.Brakes.leftPressPsi.setValue(notification.green * notification.leftBrakeFCS);
} else {
me.Brakes.leftPressPsi.setValue(0);
}
if (me.Brakes.rightbrake.getValue() > 0) {
me.Brakes.rightPressPsi.setValue(me.Psi.green.getValue() * pts.Fdm.JSBsim.Fcs.brake[1].getValue());
if (notification.rightBrake > 0) {
me.Brakes.rightPressPsi.setValue(notification.green * notification.rightBrakeFCS);
} else {
me.Brakes.rightPressPsi.setValue(0);
}
} else {
if ((me.Brakes.mode.getValue() == 2 and me.Psi.green.getValue() < 2500) or me.Brakes.mode.getValue() == 0) {
if ((notification.brakesMode == 2 and notification.green < 2500) or notification.brakesMode == 0) {
# Alternate Braking (Yellow OK + Antiskid ON + electric OK) - missing condition: BSCU OK-KO
if (me.Psi.yellow.getValue() >= 2500 and me.Brakes.askidSw.getValue() and (systems.ELEC.Bus.dc1.getValue() >= 24 or systems.ELEC.Bus.dc2.getValue() >= 24 or systems.ELEC.Bus.dcEss.getValue() >= 24)) {
if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.leftPressPsi.setValue(me.Psi.yellow.getValue() * pts.Fdm.JSBsim.Fcs.brake[0].getValue());
if (notification.yellow >= 2500 and notification.NWSSwitch and (notification.dc1 >= 24 or notification.dc2 >= 24 or notification.dcEss >= 24)) {
if (notification.leftBrake > 0 or notification.brakesMode == 0) {
me.Brakes.leftPressPsi.setValue(notification.yellow * notification.leftBrakeFCS);
} else {
me.Brakes.leftPressPsi.setValue(0);
}
if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.rightPressPsi.setValue(me.Psi.yellow.getValue() * pts.Fdm.JSBsim.Fcs.brake[1].getValue());
if (notification.rightBrake > 0 or notification.brakesMode == 0) {
me.Brakes.rightPressPsi.setValue(notification.yellow * notification.rightBrakeFCS);
} else {
me.Brakes.rightPressPsi.setValue(0);
}
} else {
# Alternate Braking (Yellow OK + Antiskid OFF + electric OK) - missing condition: BSCU OK-KO
if (me.Psi.yellow.getValue() >= 2500 and !me.Brakes.askidSw.getValue() and (systems.ELEC.Bus.dc1.getValue() >= 24 or systems.ELEC.Bus.dc2.getValue() >= 24 or systems.ELEC.Bus.dcEss.getValue() >= 24)) {
if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.leftPressPsi.setValue(1000 * pts.Fdm.JSBsim.Fcs.brake[0].getValue());
if (notification.yellow >= 2500 and !notification.NWSSwitch and (notification.dc1 >= 24 or notification.dc2 >= 24 or notification.dcEss >= 24)) {
if (notification.leftBrake > 0 or notification.brakesMode == 0) {
me.Brakes.leftPressPsi.setValue(1000 * notification.leftBrakeFCS);
} else {
me.Brakes.leftPressPsi.setValue(0);
}
if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.rightPressPsi.setValue(1000 * pts.Fdm.JSBsim.Fcs.brake[1].getValue());
if (notification.rightBrake > 0 or notification.brakesMode == 0) {
me.Brakes.rightPressPsi.setValue(1000 * notification.rightBrakeFCS);
} else {
me.Brakes.rightPressPsi.setValue(0);
}
} else {
# Alternate Braking (Yellow KO or Antiskid KO or electric KO) - missing condition: BSCU OK-KO
if (me.Brakes.accumPressPsi.getValue() < 1000 and (me.Psi.yellow.getValue() < 2500 or !me.Brakes.askidSw.getValue() or (systems.ELEC.Bus.dc1.getValue() < 24 and systems.ELEC.Bus.dc2.getValue() < 24 and systems.ELEC.Bus.dcEss.getValue() < 24))) {
if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.leftPressPsi.setValue(me.Brakes.accumPressPsi.getValue() * pts.Fdm.JSBsim.Fcs.brake[0].getValue());
if (notification.accumPressPsi < 1000 and (notification.yellow < 2500 or !notification.NWSSwitch or (notification.dc1 < 24 and notification.dc2 < 24 and notification.dcEss < 24))) {
if (notification.leftBrake > 0 or notification.brakesMode == 0) {
me.Brakes.leftPressPsi.setValue(notification.accumPressPsi * notification.leftBrakeFCS);
} else {
me.Brakes.leftPressPsi.setValue(0);
}
if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.rightPressPsi.setValue(me.Brakes.accumPressPsi.getValue() * pts.Fdm.JSBsim.Fcs.brake[1].getValue());
if (notification.rightBrake > 0 or notification.brakesMode == 0) {
me.Brakes.rightPressPsi.setValue(notification.accumPressPsi * notification.rightBrakeFCS);
} else {
me.Brakes.rightPressPsi.setValue(0);
}
} else {
if (me.Brakes.leftbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.leftPressPsi.setValue(1000 * pts.Fdm.JSBsim.Fcs.brake[0].getValue());
if (notification.leftBrake > 0 or notification.brakesMode == 0) {
me.Brakes.leftPressPsi.setValue(1000 * notification.leftBrakeFCS);
} else {
me.Brakes.leftPressPsi.setValue(0);
}
if (me.Brakes.rightbrake.getValue() > 0 or me.Brakes.mode.getValue() == 0) {
me.Brakes.rightPressPsi.setValue(1000 * pts.Fdm.JSBsim.Fcs.brake[1].getValue());
if (notification.rightBrake > 0 or notification.brakesMode == 0) {
me.Brakes.rightPressPsi.setValue(1000 * notification.rightBrakeFCS);
} else {
me.Brakes.rightPressPsi.setValue(0);
}
@ -192,3 +186,25 @@ setlistener("/controls/gear/gear-down", func {
pts.Controls.Gear.gearDown.setValue(1);
}
});
# Emesary
var A320Hydraulic = notifications.SystemRecipient.new("A320 Hydraulic",HYD.loop,HYD);
emesary.GlobalTransmitter.Register(A320Hydraulic);
var input = {
"blue": "/systems/hydraulic/blue-psi",
"green": "/systems/hydraulic/green-psi",
"yellow": "/systems/hydraulic/yellow-psi",
"brakesMode": "/systems/hydraulic/brakes/mode",
"accumPressPsi": "/systems/hydraulic/yellow-accumulator-psi-cmd",
"leftBrake": "/controls/gear/brake-left",
"rightBrake": "/controls/gear/brake-right",
"leftBrakeFCS": "/fdm/jsbsim/fcs/left-brake-cmd-norm",
"rightBrakeFCS": "/fdm/jsbsim/fcs/right-brake-cmd-norm",
"NWSSwitch": "/controls/gear/nws-switch",
};
foreach (var name; keys(input)) {
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Hydraulic", name, input[name]));
}

View file

@ -99,6 +99,8 @@ var PNEU = {
hotAir: props.globals.getNode("/systems/air-conditioning/valves/hot-air"),
starter1: props.globals.getNode("/systems/pneumatics/valves/starter-valve-1"),
starter2: props.globals.getNode("/systems/pneumatics/valves/starter-valve-2"),
wingLeft: props.globals.getNode("/systems/pneumatics/valves/wing-ice-1"),
wingRight: props.globals.getNode("/systems/pneumatics/valves/wing-ice-2"),
},
pressMode: props.globals.getNode("/systems/pressurization/mode", 1),
init: func() {
@ -159,9 +161,9 @@ var PNEU = {
me.Fail.trimValveFwd.setBoolValue(0);
me.Fail.xbleed.setBoolValue(0);
},
loop: func() {
wowl = getprop("gear/gear[1]/wow");
wowr = getprop("gear/gear[2]/wow");
loop: func(notification) {
wowl = notification.gear1Wow;
wowr = notification.gear2Wow;
# Legacy pressurization
cabinalt = getprop("/systems/pressurization/cabinalt");

View file

@ -101,3 +101,27 @@ var frameNotification = FrameNotification.new(1);
# 5 = ECAM
# 7 = FWC phases
# 10 = ECAM messages
var SystemRecipient =
{
new: func(_ident,loopFunc, instance)
{
var NewSystemRecipient = emesary.Recipient.new(_ident);
NewSystemRecipient.Receive = func(notification)
{
if (notification.NotificationType == "FrameNotification")
{
if (math.mod(notifications.frameNotification.FrameCount,5) == 0) {
call(loopFunc,[notification],instance, nil, var errors = []);
if (size(errors) > 0) {
debug.printerror(errors);
}
}
return emesary.Transmitter.ReceiptStatus_OK;
}
return emesary.Transmitter.ReceiptStatus_NotProcessed;
};
return NewSystemRecipient;
},
};

View file

@ -42,13 +42,14 @@ input = {
frame_rate: "/sim/frame-rate",
elapsedTime: "/sim/time/elapsed-sec",
FWCPhase: "/ECAM/warning-phase",
gear0Wow: "/gear/gear[0]/wow",
# Just about everything uses these properties at some stage, lets add them here!
elecAC1: "/systems/electrical/bus/ac-1",
elecAC2: "/systems/electrical/bus/ac-2",
elecACEss: "/systems/electrical/bus/ac-ess",
elecACEssShed: "/systems/electrical/bus/ac-ess-shed",
gear0Wow: "/gear/gear[0]/wow",
gear1Wow: "/gear/gear[1]/wow",
gear2Wow: "/gear/gear[2]/wow",
parkingBrake: "/controls/gear/brake-parking",
airspeedV: "/velocities/airspeed-kt",
groundspeed: "/velocities/groundspeed-kt",
engine1State: "/engines/engine[0]/state",
engine2State: "/engines/engine[1]/state",
};

View file

@ -21,6 +21,9 @@ It is highly reccomended to purchase a NAVIGRAPH subscription and download their
To install navdata, create a folder FMSDATA, and add it to your additional scenery folders, at the top of the list. Inside that folder, place all the XXXX.procedures.xml files, in the format FMSDATA/X/X/X/XXXX.procedures.xml. For instance, FMSDATA/Airports/E/G/K/EGKK.procedures.xml.
## Remote MCDU
If you want to run the MCDU on a phone or tablet for better realism and easier input, put mcdu.html into the FGDATA/Phi folder, run FlightGear with enabled HTTP server (i.e. command line --httpd=8080) and open http://your-flightgear-computer:8080/mcdu.html in the browser on your phone or tablet.
## Installation
If you have issues installing, please check INSTALL.MD!
Specifically, make sure you remove -dev from the folder name!

View file

@ -914,7 +914,7 @@
</clipto>
</pure_gain>
<pure_gain name="/instrumentation/radar-altimeter[1]/radar-altitude-ft">
<pure_gain name="/instrumentation/radar-altimeter[1]/radar-altitude-ft-corrected">
<input>/instrumentation/radar-altimeter[1]/radar-altitude-ft</input>
<gain>1</gain>
<clipto>

View file

@ -1977,6 +1977,7 @@
<test logic="AND" value="1">
/systems/electrical/some-electric-thingie/emer-elec-config eq 1
/systems/electrical/some-electric-thingie/generator-1-pb eq 1
/controls/electrical/switches/gen-1 eq 1
/controls/electrical/switches/bus-tie eq 0
</test>
</switch>
@ -1986,6 +1987,7 @@
<test logic="AND" value="1">
/systems/electrical/some-electric-thingie/emer-elec-config eq 1
/systems/electrical/some-electric-thingie/generator-2-pb eq 1
/controls/electrical/switches/gen-2 eq 1
/controls/electrical/switches/bus-tie eq 0
</test>
</switch>
@ -1995,6 +1997,7 @@
<test logic="AND" value="1">
/systems/electrical/some-electric-thingie/emer-elec-config eq 1
/systems/electrical/some-electric-thingie/generator-1-pb eq 1
/controls/electrical/switches/gen-1 eq 1
</test>
</switch>
@ -2003,6 +2006,7 @@
<test logic="AND" value="1">
/systems/electrical/some-electric-thingie/emer-elec-config eq 1
/systems/electrical/some-electric-thingie/generator-2-pb eq 1
/controls/electrical/switches/gen-2 eq 1
</test>
</switch>

View file

@ -3,13 +3,13 @@
<system name="A320: Engine Fire">
<channel name="Engine Fire" execrate="8">
<fcs_function name="enginefire1">
<fcs_function name="rubbish/enginefire1">
<function>
<sum>
<property>/systems/fire/engine1/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/engine-left-fire</independentVar>
<independentVar lookup="row">/systems/failures/fire/engine-left-fire</independentVar>
<tableData>
0 -5
1 30
@ -26,13 +26,13 @@
<output>/systems/fire/engine1/temperature</output>
</fcs_function>
<fcs_function name="enginefire2">
<fcs_function name="rubbish/enginefire2">
<function>
<sum>
<property>/systems/fire/engine2/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/engine-right-fire</independentVar>
<independentVar lookup="row">/systems/failures/fire/engine-right-fire</independentVar>
<tableData>
0 -5
1 30
@ -49,13 +49,13 @@
<output>/systems/fire/engine2/temperature</output>
</fcs_function>
<fcs_function name="apufire">
<fcs_function name="rubbish/apufire">
<function>
<sum>
<property>/systems/fire/apu/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/apu-fire</independentVar>
<independentVar lookup="row">/systems/failures/fire/apu-fire</independentVar>
<tableData>
0 -5
1 45
@ -74,13 +74,13 @@
</channel>
<channel name="Cargo Fire" execrate="8">
<fcs_function name="fwdfire">
<fcs_function name="rubbish/fwdfire">
<function>
<sum>
<property>/systems/fire/cargo/fwd/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/cargo-fwd-fire</independentVar>
<independentVar lookup="row">/systems/failures/fire/cargo-fwd-fire</independentVar>
<tableData>
0 -5
1 30
@ -97,13 +97,13 @@
<output>/systems/fire/cargo/fwd/temperature</output>
</fcs_function>
<fcs_function name="aftfire">
<fcs_function name="rubbish/aftfire">
<function>
<sum>
<property>/systems/fire/cargo/aft/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/cargo-aft-fire</independentVar>
<independentVar lookup="row">/systems/failures/fire/cargo-aft-fire</independentVar>
<tableData>
0 -5
1 45
@ -119,5 +119,35 @@
</clipto>
<output>/systems/fire/cargo/aft/temperature</output>
</fcs_function>
<fcs_function name="rubbish/lavatory">
<function>
<sum>
<property>/systems/fire/lavatory/temperature</property>
<product>
<table>
<independentVar lookup="row">/systems/failures/fire/lavatory-fire</independentVar>
<tableData>
0 -5
1 45
</tableData>
</table>
<property>simulation/channel-dt</property>
</product>
</sum>
</function>
<clipto>
<min>0</min>
<max>300</max>
</clipto>
<output>/systems/fire/lavatory/temperature</output>
</fcs_function>
<switch name="/systems/fire/lavatory/warning">
<default value="0"/>
<test logic="OR" value="1">
/systems/fire/lavatory/temperature ge 295
</test>
</switch>
</channel>
</system>

View file

@ -632,9 +632,9 @@
/systems/fuel/quantity/center-low eq 1
/systems/fuel/feed-center-2 eq 0
</test>
/systems/fuel/feed-left-inner eq 0
/systems/fuel/feed-right-inner eq 1
/systems/fuel/valves/crossfeed-valve eq 1
/consumables/fuel/tank[1]/level-gal_us le /consumables/fuel/tank[3]/unusable-gal_us
/consumables/fuel/tank[3]/level-gal_us gt /consumables/fuel/tank[3]/unusable-gal_us
propulsion/tank[5]/contents-lbs lt 9
</test>
@ -648,9 +648,9 @@
/systems/fuel/feed-center-1 eq 0
</test>
/systems/fuel/feed-left-inner eq 1
/systems/fuel/feed-right-inner eq 0
/systems/fuel/valves/crossfeed-valve eq 1
/consumables/fuel/tank[1]/level-gal_us gt /consumables/fuel/tank[1]/unusable-gal_us
/consumables/fuel/tank[3]/level-gal_us le /consumables/fuel/tank[3]/unusable-gal_us
propulsion/tank[6]/contents-lbs lt 9
</test>
</switch>

View file

@ -229,6 +229,14 @@
</test>
</test>
</switch>
<switch name="/ECAM/phases/monostable/phase-8">
<default value="0"/>
<test logic="OR" value="1">
/ECAM/warning-phase eq 8
</test>
</switch>
</channel>
</system>

File diff suppressed because it is too large Load diff

View file

@ -528,12 +528,12 @@
<default value="0"/>
<test logic="AND" value="1">
/controls/gear/brake-parking ne 1
/systems/hydraulic/brakes/askidnwssw eq 1
/controls/gear/nws-switch eq 1
/systems/hydraulic/green-psi ge 2500
</test>
<test logic="AND" value="2">
/controls/gear/brake-parking ne 1
/systems/hydraulic/brakes/askidnwssw eq 1
/controls/gear/nws-switch eq 1
/systems/hydraulic/yellow-psi ge 2500
</test>
<test logic="AND" value="2">
@ -610,34 +610,34 @@
</test>
</switch>
<switch name="/systems/hydraulics/warnings/blue-lo-pr">
<switch name="/systems/hydraulic/warnings/blue-lo-pr">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/blue-psi lt 1750
/systems/hydraulics/warnings/blue-lo-pr eq 1
/systems/hydraulic/warnings/blue-lo-pr eq 1
</test>
/systems/hydraulic/blue-psi lt 1450
</test>
</switch>
<switch name="/systems/hydraulics/warnings/green-lo-pr">
<switch name="/systems/hydraulic/warnings/green-lo-pr">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/green-psi lt 1750
/systems/hydraulics/warnings/green-lo-pr eq 1
/systems/hydraulic/warnings/green-lo-pr eq 1
</test>
/systems/hydraulic/green-psi lt 1450
</test>
</switch>
<switch name="/systems/hydraulics/warnings/yellow-lo-pr">
<switch name="/systems/hydraulic/warnings/yellow-lo-pr">
<default value="0"/>
<test logic="OR" value="1">
<test logic="AND">
/systems/hydraulic/yellow-psi lt 1750
/systems/hydraulics/warnings/yellow-lo-pr eq 1
/systems/hydraulic/warnings/yellow-lo-pr eq 1
</test>
/systems/hydraulic/yellow-psi lt 1450
</test>

View file

@ -1183,28 +1183,47 @@
<rate_limit sense="decr">120</rate_limit>
</actuator>
<switch name="/systems/pneumatics/warnings/crossbleed-disag-open">
<switch name="/systems/pneumatics/warnings/crossbleed-disag-open-man">
<default value="0"/>
<test logic="AND" value="1">
/systems/pneumatics/valves/crossbleed-valve-cmd eq 1
/systems/pneumatics/valves/crossbleed-valve ne 1
/controls/pneumatics/switches/x-bleed eq 2
</test>
</switch>
<switch name="/systems/pneumatics/warnings/crossbleed-disag-open-auto">
<default value="0"/>
<test logic="AND" value="1">
/systems/pneumatics/valves/crossbleed-valve-cmd eq 1
/systems/pneumatics/valves/crossbleed-valve ne 1
/controls/pneumatics/switches/x-bleed eq 1
/systems/electrical/bus/dc-2 ge 25
</test>
</switch>
<switch name="/systems/pneumatics/warnings/crossbleed-disag">
<switch name="/systems/pneumatics/warnings/crossbleed-disag-open">
<default value="0"/>
<test logic="OR" value="1">
/systems/pneumatics/warnings/crossbleed-disag-open-man eq 1
<test logic="AND">
/systems/pneumatics/warnings/crossbleed-disag-open-auto eq 1
/systems/electrical/bus/dc-2 ge 25
</test>
</test>
</switch>
<switch name="/systems/pneumatics/warnings/crossbleed-disag-closed">
<default value="0"/>
<test logic="AND" value="1">
/systems/pneumatics/valves/crossbleed-valve-cmd eq 0
/systems/pneumatics/valves/crossbleed-valve ne 0
</test>
<test logic="AND" value="1">
</switch>
<switch name="/systems/pneumatics/warnings/crossbleed-disag">
<default value="0"/>
<test logic="OR" value="1">
/systems/pneumatics/warnings/crossbleed-disag-closed eq 1
/systems/pneumatics/warnings/crossbleed-disag-open eq 1
</test>
</switch>

View file

@ -6,24 +6,22 @@
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>0.1</value>
<value>1.0</value>
</time>
<S>
<property>/controls/electrical/switches/gen-1</property>
<not><property>/controls/electrical/switches/gen-1</property></not>
</S>
<output>/systems/electrical/some-electric-thingie/generator-1-pb</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>0.1</value>
<value>1.0</value>
</time>
<S>
<property>/controls/electrical/switches/gen-2</property>
<not><property>/controls/electrical/switches/gen-2</property></not>
</S>
<output>/systems/electrical/some-electric-thingie/generator-2-pb</output>
</flipflop>
@ -80,6 +78,29 @@
<output>/systems/electrical/some-electric-thingie/generator-2-reset</output>
</flipflop>
<flipflop>
<type>monostable</type>
<time>
<value>10.0</value>
</time>
<S>
<not><property>/systems/electrical/some-electric-thingie/emer-elec-config</property></not>
</S>
<output>/systems/electrical/some-electric-thingie/emer-elec-config-10-sec</output>
</flipflop>
<flipflop>
<type>monostable</type>
<time>
<value>20.0</value>
</time>
<S>
<not><property>/systems/electrical/some-electric-thingie/emer-elec-config</property></not>
</S>
<output>/systems/electrical/some-electric-thingie/emer-elec-config-20-sec</output>
</flipflop>
<flipflop>
<type>RS</type>
<S>
@ -303,7 +324,7 @@
<output>ECAM/warnings/altitude-alert/gear-downlocked-output</output>
</flipflop>
<!-- falling edge detector - take inverse of following -->
<!-- falling edge detector - switch and output both false -->
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
@ -311,9 +332,9 @@
<value>4.5</value>
</time>
<S>
<property>ECAM/phases/monostable/phase-8</property>
<property>/ECAM/phases/monostable/phase-8</property>
</S>
<output>ECAM/phases/monostable/phase-8-output</output>
<output>/ECAM/phases/monostable/phase-8-output</output>
</flipflop>
<flipflop>
@ -412,30 +433,6 @@
</flipflop>
<!-- falling edge detectors -->
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>10.0</value>
</time>
<S>
<property>/ECAM/warnings/timer/xbleed-fault-output</property>
</S>
<output>/ECAM/warnings/timer/xbleed-fault-output-10</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>15.0</value>
</time>
<S>
<property>/controls/engines/engine[0]/fire-btn</property>
</S>
<output>/ECAM/warnings/timer/xbleed-fault-output-15</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
@ -926,7 +923,7 @@
<value>1.0</value>
</time>
<S>
<property>/ECAM/warnings/logic/stall/phase-8</property>
<property>/ECAM/phases/monostable/phase-8</property>
</S>
<output>/ECAM/warnings/logic/stall/phase-8-output</output>
</flipflop>
@ -1029,4 +1026,139 @@
</R>
<output>/ECAM/phases/phase-calculation/altitude-ge-800</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/fctl/flaps-config-set</property>
</S>
<R>
<property>/ECAM/warnings/fctl/flaps-config-reset</property>
</R>
<output>/ECAM/warnings/fctl/flaps-config-output</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/fctl/slats-config-set</property>
</S>
<R>
<property>/ECAM/warnings/fctl/slats-config-reset</property>
</R>
<output>/ECAM/warnings/fctl/slats-config-output</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/fctl/spd-brk-config-set</property>
</S>
<R>
<property>/ECAM/warnings/fctl/spd-brk-config-reset</property>
</R>
<output>/ECAM/warnings/fctl/spd-brk-config-output</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/fctl/pitch-trim-config-set</property>
</S>
<R>
<property>/ECAM/warnings/fctl/pitch-trim-config-reset</property>
</R>
<output>/ECAM/warnings/fctl/pitch-trim-config-output</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/fctl/rudder-trim-config-set</property>
</S>
<R>
<property>/ECAM/warnings/fctl/rudder-trim-config-reset</property>
</R>
<output>/ECAM/warnings/fctl/rudder-trim-config-output</output>
</flipflop>
<flipflop>
<type>SR</type>
<S>
<property>/ECAM/warnings/fctl/park-brk-config-set</property>
</S>
<R>
<property>/ECAM/warnings/fctl/park-brk-config-reset</property>
</R>
<output>/ECAM/warnings/fctl/park-brk-config-output</output>
</flipflop>
<flipflop>
<type>RS</type>
<S>
<property>/ECAM/warnings/logic/eng/eng-1-fail-cond-set</property>
</S>
<R>
<property>/ECAM/warnings/logic/eng/eng-1-fail-cond-reset</property>
</R>
<output>/ECAM/warnings/logic/eng/eng-1-fail-cond</output>
</flipflop>
<flipflop>
<type>RS</type>
<S>
<property>/ECAM/warnings/logic/eng/eng-2-fail-cond-set</property>
</S>
<R>
<property>/ECAM/warnings/logic/eng/eng-2-fail-cond-reset</property>
</R>
<output>/ECAM/warnings/logic/eng/eng-2-fail-cond</output>
</flipflop>
<flipflop>
<type>RS</type>
<S>
<property>/ECAM/warnings/logic/eng/eng-1-fail-set</property>
</S>
<R>
<property>/ECAM/warnings/logic/eng/eng-1-fail-reset</property>
</R>
<output>/ECAM/warnings/logic/eng/eng-1-fail-output</output>
</flipflop>
<flipflop>
<type>RS</type>
<S>
<property>/ECAM/warnings/logic/eng/eng-2-fail-set</property>
</S>
<R>
<property>/ECAM/warnings/logic/eng/eng-2-fail-reset</property>
</R>
<output>/ECAM/warnings/logic/eng/eng-2-fail-output</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>30.0</value>
</time>
<S>
<property>/ECAM/warnings/logic/eng/phase-5</property>
</S>
<output>/ECAM/warnings/logic/eng/phase-5-output</output>
</flipflop>
<flipflop>
<type>monostable</type>
<inverted type="bool">true</inverted>
<time>
<value>1.0</value>
</time>
<S>
<property>/ECAM/warnings/logic/eng/phase-5-output</property>
</S>
<output>/ECAM/warnings/logic/eng/phase-5-output-2</output>
</flipflop>
</PropertyList>

View file

@ -10,7 +10,7 @@
<name>OAT Thrust Scale</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -28,7 +28,7 @@
<name>FLX Thrust Scale</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -46,7 +46,7 @@
<name>IDLE Limit</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<condition>
<and>
@ -81,11 +81,44 @@
<output>/controls/engines/idle-limit</output>
</filter>
<filter>
<name>Engines At Idle Stage 1</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<difference>
<table>
<max>
<property>/engines/engine[0]/n1-actual</property>
<property>/engines/engine[1]/n1-actual</property>
</max>
<entry><ind> 18.9</ind><dep>0</dep></entry>
<entry><ind>103.8</ind><dep>1</dep></entry>
</table>
<value>0.005</value>
</difference>
</expression>
</input>
<output>/engines/highest-n1-buffer</output>
</filter>
<logic>
<name>Engines At Idle Stage 2</name>
<input>
<less-than-equals>
<property>/engines/highest-n1-buffer</property>
<property>/controls/engines/idle-limit</property>
</less-than-equals>
</input>
<output>/engines/both-at-idle</output>
</logic>
<filter>
<name>MAN One</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -107,7 +140,7 @@
<name>MAN Two</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -129,7 +162,7 @@
<name>MAN CMD One</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<product>
@ -154,7 +187,7 @@
<name>MAN CMD Two</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<product>
@ -179,7 +212,7 @@
<name>N1 CMD 1</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<condition>
<and>
@ -220,7 +253,7 @@
<name>N1 CMD 2</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<condition>
<and>
@ -1057,7 +1090,7 @@
<name>N1 Limit TOGA</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1077,7 +1110,7 @@
<name>N1 Limit MCT</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1097,7 +1130,7 @@
<name>N1 Limit FLX</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1117,7 +1150,7 @@
<name>N1 Limit CLB</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>

View file

@ -10,7 +10,7 @@
<name>OAT Thrust Scale</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -28,7 +28,7 @@
<name>FLX Thrust Scale</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -46,7 +46,7 @@
<name>IDLE Limit</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<condition>
<and>
@ -81,11 +81,44 @@
<output>/controls/engines/idle-limit</output>
</filter>
<filter>
<name>Engines At Idle Stage 1</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<difference>
<table>
<max>
<property>/engines/engine[0]/n1-actual</property>
<property>/engines/engine[1]/n1-actual</property>
</max>
<entry><ind> 22.4</ind><dep>0</dep></entry>
<entry><ind>103.8</ind><dep>1</dep></entry>
</table>
<value>0.005</value>
</difference>
</expression>
</input>
<output>/engines/highest-n1-buffer</output>
</filter>
<logic>
<name>Engines At Idle Stage 2</name>
<input>
<less-than-equals>
<property>/engines/highest-n1-buffer</property>
<property>/controls/engines/idle-limit</property>
</less-than-equals>
</input>
<output>/engines/both-at-idle</output>
</logic>
<filter>
<name>MAN One</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -107,7 +140,7 @@
<name>MAN Two</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -129,7 +162,7 @@
<name>MAN CMD One</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<product>
@ -154,7 +187,7 @@
<name>MAN CMD Two</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<product>
@ -1345,7 +1378,7 @@
<name>EPR Limit TOGA</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1373,7 +1406,7 @@
<name>EPR CMD TOGA</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<sum>
@ -1389,7 +1422,7 @@
<name>EPR Limit MCT</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1417,7 +1450,7 @@
<name>EPR CMD MCT</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<sum>
@ -1433,7 +1466,7 @@
<name>EPR Limit FLX</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1461,7 +1494,7 @@
<name>EPR CMD FLX</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<sum>
@ -1477,7 +1510,7 @@
<name>EPR Limit CLB</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<table>
@ -1505,7 +1538,7 @@
<name>EPR CMD CLB</name>
<type>gain</type>
<gain>1.0</gain>
<update-interval-secs type="double">0.05</update-interval-secs>
<update-interval-secs>0.05</update-interval-secs>
<input>
<expression>
<sum>

211
mcdu.html Normal file
View file

@ -0,0 +1,211 @@
<!DOCTYPE html>
<html>
<head>
<title>MCDU</title>
<meta charset="utf-8"/>
<script>
let screen;
let screen_src;
let loading = 0;
let scheduled_load = 0;
function refresh_screen() {
if (loading) {
scheduled_load = 1;
}
else {
loading = 1;
screen.src = screen_src + '&random=' + (new Date).getTime()
}
}
function press_button(type, text) {
let request = new XMLHttpRequest;
request.open(
"POST",
window.location.protocol + "//" + window.location.host + "/run.cgi?value=nasal"
);
request.setRequestHeader("Content-Type", "application/json");
let body = JSON.stringify({
"name": "",
"children": [
{
"name": "script",
"index": 0,
"value": "mcdu." + type + "(\"" + text + "\", 0);"
}
]
});
request.send(body);
request.addEventListener('load', function() {
refresh_screen();
}, true);
}
window.addEventListener('load', function() {
let tds = document.querySelectorAll('.input td');
for (const td of tds) {
td.addEventListener('click', function() {
press_button("button", td.textContent);
}, true);
}
tds = document.querySelectorAll('.enter td');
for (const td of tds) {
td.addEventListener('click', function() {
press_button(td.nextSibling ? "lskbutton" : "rskbutton", td.textContent);
}, true);
}
tds = document.querySelectorAll('.menu td');
for (const td of tds) {
td.addEventListener('click', function() {
press_button("pagebutton", td.className);
}, true);
}
tds = document.querySelectorAll('.arrows td');
for (const td of tds) {
td.addEventListener('click', function() {
press_button(td.className == 'airport' ? "pagebutton" : "arrowbutton", td.className);
}, true);
}
screen = document.querySelector('img');
screen.addEventListener('load', function() {
loading = 0;
if (scheduled_load) {
scheduled_load = 0;
refresh_screen();
}
});
screen_src = screen.src;
window.setInterval(refresh_screen, 1000);
}, true);
</script>
<style>
body { font-size: 5rem; margin: 0; padding: 0; background-color: black; color: white; }
table { margin: 0; padding: 0 }
tr { margin: 0; padding: 0 }
td { margin: 0; padding: 0; text-align: center; outline: 1px solid gray; }
td:active { background-color: white; color: black }
.enter { font-size: 60% }
.enter tr:first-child { font-size: 70% }
.enter tr:last-child { font-size: 50% }
.enter td:first-child, .enter td:last-child { padding: 0 0.55em; }
.menu, .arrows .airport { font-size: 40%; line-height: 1em; }
.menu td { height: 2.5em; }
.arrows td { width: 50%; padding: 0; font-size: 60%; }
img { display: block; }
</style>
</head>
<body style="width: 100%">
<table class="enter" style="width: 92%">
<tr>
<td>&nbsp;</td>
<td rowspan="8" style="vertical-align: top"><img src="/screenshot?canvasindex=10&type=png" style="width: 100%"/></td>
<td>&nbsp;</td>
</tr>
<tr><td>1</td><td>1</td></tr>
<tr><td>2</td><td>2</td></tr>
<tr><td>3</td><td>3</td></tr>
<tr><td>4</td><td>4</td></tr>
<tr><td>5</td><td>5</td></tr>
<tr><td>6</td><td>6</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
</table>
<table class="menu" style="width: 92%">
<tr>
<td class="dirto">DIR</td>
<td class="prog">PROG</td>
<td class="perf">PERF</td>
<td class="init">INIT</td>
<td class="data">DATA</td>
<td></td>
<td>BRT</td>
</tr>
<tr>
<td class="f-pln">F-PLN</td>
<td class="radnav">RAD<br/>NAV</td>
<td class="fuel-pred">FUEL<br/>PRED</td>
<td>SEC<br/>F-PLN</td>
<td class="atc">ATC<br/>COMM</td>
<td class="mcdu">MCDU<br/>MENU</td>
<td>DIM</td>
</tr>
</table>
<table class="input" style="float: right; width: 62.5%">
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
<td>E</td>
</tr>
<tr>
<td>F</td>
<td>G</td>
<td>H</td>
<td>I</td>
<td>J</td>
</tr>
<tr>
<td>K</td>
<td>L</td>
<td>M</td>
<td>N</td>
<td>O</td>
</tr>
<tr>
<td>P</td>
<td>Q</td>
<td>R</td>
<td>S</td>
<td>T</td>
</tr>
<tr>
<td>U</td>
<td>V</td>
<td>W</td>
<td>X</td>
<td>Y</td>
</tr>
<tr>
<td>Z</td>
<td>/</td>
<td style="font-size: 50%">SP</td>
<td style="font-size: 25%">OVFY</td>
<td style="font-size: 33%">CLR</td>
</tr>
</table>
<table class="arrows" style="width: 25%">
<tr>
<td class="airport">AIR<br/>PORT</td>
<td></td>
</tr>
<tr>
<td class="left"></td>
<td class="up"></td>
</tr>
<tr>
<td class="right"></td>
<td class="down"></td>
</tr>
</table>
<table class="input" style="width: 30%">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
<tr>
<td>.</td>
<td>0</td>
<td>-</td>
</tr>
</table>
</body>
</html>

View file

@ -1 +1 @@
46
48