commit
0c8ba2fa8f
48 changed files with 7687 additions and 1548 deletions
|
@ -431,7 +431,7 @@
|
||||||
<z-offset-max-m type="float">300.0</z-offset-max-m>
|
<z-offset-max-m type="float">300.0</z-offset-max-m>
|
||||||
</current-view>
|
</current-view>
|
||||||
|
|
||||||
<minimum-fg-version>2019.2.0</minimum-fg-version>
|
<minimum-fg-version>2019.1.2</minimum-fg-version>
|
||||||
</sim>
|
</sim>
|
||||||
|
|
||||||
<consumables>
|
<consumables>
|
||||||
|
@ -1905,11 +1905,20 @@
|
||||||
<file>Aircraft/A320-family/Nasal/FMGC/FCU.nas</file>
|
<file>Aircraft/A320-family/Nasal/FMGC/FCU.nas</file>
|
||||||
</fcu>
|
</fcu>
|
||||||
<fmgc>
|
<fmgc>
|
||||||
|
<file>Aircraft/A320-family/Nasal/FMGC/flightplan.nas</file>
|
||||||
<file>Aircraft/A320-family/Nasal/FMGC/FMGC.nas</file>
|
<file>Aircraft/A320-family/Nasal/FMGC/FMGC.nas</file>
|
||||||
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-b.nas</file>
|
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-b.nas</file>
|
||||||
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-c.nas</file>
|
<file>Aircraft/A320-family/Nasal/FMGC/FMGC-c.nas</file>
|
||||||
</fmgc>
|
</fmgc>
|
||||||
<mcdu>
|
<mcdu>
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/DUPLICATE.nas</file> <!-- dynamic page - init before others as used in various pages -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/DIRTO.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/LATREV.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/VERTREV.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/DEPARTURE.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/ARRIVAL.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/HOLD.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
|
<file>Aircraft/A320-family/Nasal/MCDU/F-PLN.nas</file> <!-- dynamic page - init before MCDU -->
|
||||||
<file>Aircraft/A320-family/Nasal/MCDU/MCDU.nas</file>
|
<file>Aircraft/A320-family/Nasal/MCDU/MCDU.nas</file>
|
||||||
<file>Aircraft/A320-family/Nasal/MCDU/INITA.nas</file>
|
<file>Aircraft/A320-family/Nasal/MCDU/INITA.nas</file>
|
||||||
<file>Aircraft/A320-family/Nasal/MCDU/INITB.nas</file>
|
<file>Aircraft/A320-family/Nasal/MCDU/INITB.nas</file>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -251,6 +251,31 @@
|
||||||
</action>
|
</action>
|
||||||
</animation>
|
</animation>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>pick</type>
|
||||||
|
<object-name>dir</object-name>
|
||||||
|
<action>
|
||||||
|
<button>0</button>
|
||||||
|
<repeatable>false</repeatable>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>mcdu.pagebutton("dirto", 0);</script>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<greater-than-equals>
|
||||||
|
<property>systems/electrical/bus/ac-1</property>
|
||||||
|
<value>110</value>
|
||||||
|
</greater-than-equals>
|
||||||
|
<greater-than>
|
||||||
|
<property>controls/lighting/DU/mcdu1</property>
|
||||||
|
<value>0.01</value>
|
||||||
|
</greater-than>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</binding>
|
||||||
|
</action>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>pick</type>
|
<type>pick</type>
|
||||||
<object-name>L1</object-name>
|
<object-name>L1</object-name>
|
||||||
|
|
|
@ -251,6 +251,31 @@
|
||||||
</action>
|
</action>
|
||||||
</animation>
|
</animation>
|
||||||
|
|
||||||
|
<animation>
|
||||||
|
<type>pick</type>
|
||||||
|
<object-name>dir</object-name>
|
||||||
|
<action>
|
||||||
|
<button>0</button>
|
||||||
|
<repeatable>false</repeatable>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>mcdu.pagebutton("dirto", 1);</script>
|
||||||
|
<condition>
|
||||||
|
<and>
|
||||||
|
<greater-than-equals>
|
||||||
|
<property>systems/electrical/bus/ac-2</property>
|
||||||
|
<value>110</value>
|
||||||
|
</greater-than-equals>
|
||||||
|
<greater-than>
|
||||||
|
<property>controls/lighting/DU/mcdu2</property>
|
||||||
|
<value>0.01</value>
|
||||||
|
</greater-than>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</binding>
|
||||||
|
</action>
|
||||||
|
</animation>
|
||||||
|
|
||||||
<animation>
|
<animation>
|
||||||
<type>pick</type>
|
<type>pick</type>
|
||||||
<object-name>L1</object-name>
|
<object-name>L1</object-name>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
viewBox="0 0 1024 864"
|
viewBox="0 0 1024 864"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg2"
|
id="svg2"
|
||||||
inkscape:version="1.0beta2 (2b71d25, 2019-12-03)"
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||||
sodipodi:docname="mcdu.svg">
|
sodipodi:docname="mcdu.svg">
|
||||||
<metadata
|
<metadata
|
||||||
id="metadata375">
|
id="metadata375">
|
||||||
|
@ -37,17 +37,17 @@
|
||||||
guidetolerance="20"
|
guidetolerance="20"
|
||||||
inkscape:pageopacity="1"
|
inkscape:pageopacity="1"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:window-width="1920"
|
inkscape:window-width="1366"
|
||||||
inkscape:window-height="1035"
|
inkscape:window-height="705"
|
||||||
id="namedview371"
|
id="namedview371"
|
||||||
showgrid="true"
|
showgrid="true"
|
||||||
inkscape:zoom="0.5"
|
inkscape:zoom="1.5306292"
|
||||||
inkscape:cx="997.98642"
|
inkscape:cx="1100.8644"
|
||||||
inkscape:cy="772.65269"
|
inkscape:cy="75.945873"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="-8"
|
||||||
inkscape:window-y="23"
|
inkscape:window-y="-8"
|
||||||
inkscape:window-maximized="1"
|
inkscape:window-maximized="1"
|
||||||
inkscape:current-layer="Simple"
|
inkscape:current-layer="svg2"
|
||||||
showguides="false"
|
showguides="false"
|
||||||
inkscape:snap-global="false"
|
inkscape:snap-global="false"
|
||||||
units="px"
|
units="px"
|
||||||
|
@ -872,6 +872,579 @@
|
||||||
id="tspan4269-7"
|
id="tspan4269-7"
|
||||||
sodipodi:role="line">TEXT</tspan></text>
|
sodipodi:role="line">TEXT</tspan></text>
|
||||||
</g>
|
</g>
|
||||||
|
<g
|
||||||
|
id="g1390"
|
||||||
|
transform="translate(-0.25527898,1.4267237)"
|
||||||
|
inkscape:label="FPLN"
|
||||||
|
style="display:inline">
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="Simple-9"
|
||||||
|
inkscape:label="Simple">
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="Simple_Center-6"
|
||||||
|
inkscape:label="Simple_Center" />
|
||||||
|
<circle
|
||||||
|
id="path4227-0"
|
||||||
|
style="fill:#000000;stroke:none"
|
||||||
|
cx="700.88422"
|
||||||
|
cy="15.471865"
|
||||||
|
r="1.5" />
|
||||||
|
<circle
|
||||||
|
id="path4229-4"
|
||||||
|
style="fill:#000000;stroke:none"
|
||||||
|
cx="763.95813"
|
||||||
|
cy="15.754708"
|
||||||
|
r="1.5" />
|
||||||
|
<circle
|
||||||
|
id="path4231-7"
|
||||||
|
style="fill:#000000;stroke:none"
|
||||||
|
cx="787.43408"
|
||||||
|
cy="16.320395"
|
||||||
|
r="1.5" />
|
||||||
|
<circle
|
||||||
|
id="path4233-7"
|
||||||
|
style="fill:#000000;stroke:none"
|
||||||
|
cx="796.48511"
|
||||||
|
cy="13.774809"
|
||||||
|
r="3" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="INITA-9"
|
||||||
|
inkscape:label="INITA" />
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="INITB-0"
|
||||||
|
inkscape:label="INITB" />
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="PERFTO-8"
|
||||||
|
inkscape:label="PERFTO" />
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
id="FPLN"
|
||||||
|
inkscape:label="FPLN">
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="750.78857"
|
||||||
|
y="69.238258"
|
||||||
|
id="FPLN_Callsign"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
inkscape:label="#text4244"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan4388"
|
||||||
|
x="750.78857"
|
||||||
|
y="69.238258"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">CALLSIG</tspan></text>
|
||||||
|
<g
|
||||||
|
inkscape:label="#g3767"
|
||||||
|
id="FPLN_TMPY_group">
|
||||||
|
<text
|
||||||
|
inkscape:label="#text4244"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
id="FPLN_TMPY"
|
||||||
|
y="69.238258"
|
||||||
|
x="350.9628"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
xml:space="preserve"><tspan
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffff00;fill-opacity:1"
|
||||||
|
y="69.238258"
|
||||||
|
x="350.9628"
|
||||||
|
id="tspan3617"
|
||||||
|
sodipodi:role="line">TMPY</tspan></text>
|
||||||
|
<g
|
||||||
|
id="FPLN_TMPY_ERASE"
|
||||||
|
inkscape:label="#g3715">
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="63.16515"
|
||||||
|
y="773.87396"
|
||||||
|
id="text3623"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
inkscape:label="#text4244"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan3625"
|
||||||
|
x="63.16515"
|
||||||
|
y="773.87396"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1">ERASE</tspan></text>
|
||||||
|
<text
|
||||||
|
inkscape:label="#text4244"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
id="text3627"
|
||||||
|
y="717.159"
|
||||||
|
x="70.001091"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
xml:space="preserve"><tspan
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1"
|
||||||
|
y="717.159"
|
||||||
|
x="70.001091"
|
||||||
|
id="tspan3629"
|
||||||
|
sodipodi:role="line">TMPY</tspan></text>
|
||||||
|
<g
|
||||||
|
id="g4241"
|
||||||
|
inkscape:label="#g4241"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,710.38932)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path4480-4"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path4482-0"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path4484-0"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="FPLN_TMPY_INSERT"
|
||||||
|
inkscape:label="#g3746">
|
||||||
|
<text
|
||||||
|
inkscape:label="#text4244"
|
||||||
|
transform="scale(0.9915153,1.0085573)"
|
||||||
|
id="text3729"
|
||||||
|
y="717.15857"
|
||||||
|
x="970.52771"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
xml:space="preserve"><tspan
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1"
|
||||||
|
y="717.15857"
|
||||||
|
x="970.52771"
|
||||||
|
id="tspan3731"
|
||||||
|
sodipodi:role="line">TMPY</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="972.33221"
|
||||||
|
y="773.87335"
|
||||||
|
id="text3725"
|
||||||
|
transform="scale(0.99151523,1.0085574)"
|
||||||
|
inkscape:label="#text4244"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan3727"
|
||||||
|
x="972.33221"
|
||||||
|
y="773.87335"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1">INSERT</tspan></text>
|
||||||
|
<g
|
||||||
|
id="g4324"
|
||||||
|
inkscape:label="#g4324"
|
||||||
|
transform="matrix(1.0807108,0,0,1.0807111,-76.371959,450.13459)">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path4490-7"
|
||||||
|
d="M 998.71909,284.70793 H 970.18944"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 994.54102,294.79468 -20.17351,-20.1735"
|
||||||
|
id="path4318-2"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path4320-1"
|
||||||
|
d="m 984.45427,298.97275 -10e-6,-28.52964"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 974.36752,294.79468 20.17349,-20.1735"
|
||||||
|
id="path4322-2"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="177.72771"
|
||||||
|
y="68.861366"
|
||||||
|
id="FPLN_FROM"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
inkscape:label="#text4244"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan1240"
|
||||||
|
x="177.72771"
|
||||||
|
y="68.861366"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:51.20000076px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1">FROM</tspan></text>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:label="#g3767"
|
||||||
|
id="DIRTO_TMPY_group">
|
||||||
|
<g
|
||||||
|
id="DIRTO_TMPY_ERASE"
|
||||||
|
inkscape:label="#g3715">
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="63.16515"
|
||||||
|
y="773.87396"
|
||||||
|
id="text174"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
inkscape:label="#text4244"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan172"
|
||||||
|
x="63.16515"
|
||||||
|
y="773.87396"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1">ERASE</tspan></text>
|
||||||
|
<text
|
||||||
|
inkscape:label="#text4244"
|
||||||
|
transform="scale(0.991516,1.0085566)"
|
||||||
|
id="text178"
|
||||||
|
y="717.159"
|
||||||
|
x="73.163895"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
xml:space="preserve"><tspan
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#bb6100;fill-opacity:1"
|
||||||
|
y="717.159"
|
||||||
|
x="73.163895"
|
||||||
|
id="tspan176"
|
||||||
|
sodipodi:role="line">DIR TO</tspan></text>
|
||||||
|
<g
|
||||||
|
id="g186"
|
||||||
|
inkscape:label="#g4241"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,710.38932)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path180"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path182"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path184"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="g207"
|
||||||
|
inkscape:label="#g3746">
|
||||||
|
<text
|
||||||
|
inkscape:label="#text4244"
|
||||||
|
transform="scale(0.9915153,1.0085573)"
|
||||||
|
id="text191"
|
||||||
|
y="717.15857"
|
||||||
|
x="937.84546"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
xml:space="preserve"><tspan
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:56px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1"
|
||||||
|
y="717.15857"
|
||||||
|
x="947.84546"
|
||||||
|
id="tspan189"
|
||||||
|
sodipodi:role="line">DIR TO</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#bb6100;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="972.33221"
|
||||||
|
y="773.87335"
|
||||||
|
id="text195"
|
||||||
|
transform="scale(0.99151523,1.0085574)"
|
||||||
|
inkscape:label="#text4244"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan193"
|
||||||
|
x="972.33221"
|
||||||
|
y="773.87335"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:end;text-anchor:end;fill:#bb6100;fill-opacity:1">INSERT</tspan></text>
|
||||||
|
<g
|
||||||
|
id="g205"
|
||||||
|
inkscape:label="#g4324"
|
||||||
|
transform="matrix(1.0807108,0,0,1.0807111,-76.371959,450.13459)">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path197"
|
||||||
|
d="M 998.71909,284.70793 H 970.18944"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 994.54102,294.79468 -20.17351,-20.1735"
|
||||||
|
id="path199"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path201"
|
||||||
|
d="m 984.45427,298.97275 -10e-6,-28.52964"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 974.36752,294.79468 20.17349,-20.1735"
|
||||||
|
id="path203"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:label="arrowsDepArr"
|
||||||
|
id="arrowsDepArr">
|
||||||
|
<g
|
||||||
|
id="arrow5L"
|
||||||
|
inkscape:label="arrow5L"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,589.53826)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path301"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path303"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path305"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,472.51698)"
|
||||||
|
inkscape:label="arrow4L"
|
||||||
|
id="arrow4L">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
id="path417"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path419"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
id="path421"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="arrow3L"
|
||||||
|
inkscape:label="arrow3L"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,353.79358)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path425"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path427"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path429"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,235.49571)"
|
||||||
|
inkscape:label="arrow2L"
|
||||||
|
id="arrow2L">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
id="path433"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path435"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
id="path437"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="arrow1L"
|
||||||
|
inkscape:label="arrow1L"
|
||||||
|
transform="matrix(1.0000008,0,0,0.99998914,-895.98809,118.0489)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path471"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path473"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path475"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1"
|
||||||
|
transform="matrix(-1.0000008,0,0,0.99998914,1920.5256,589.53826)"
|
||||||
|
inkscape:label="arrow5R"
|
||||||
|
id="arrow5R">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
id="path479"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path481"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
id="path483"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="arrow4R"
|
||||||
|
inkscape:label="arrow4R"
|
||||||
|
transform="matrix(-1.0000008,0,0,0.99998914,1920.5256,472.51698)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path487"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path489"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path491"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1"
|
||||||
|
transform="matrix(-1.0000008,0,0,0.99998914,1920.5256,353.79358)"
|
||||||
|
inkscape:label="arrow3R"
|
||||||
|
id="arrow3R">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
id="path495"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path497"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
id="path499"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
id="arrow2R"
|
||||||
|
inkscape:label="arrow2R"
|
||||||
|
transform="matrix(-1.0000008,0,0,0.99998914,1920.5256,235.49571)"
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path503"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
id="path505"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path507"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="stroke:#bb6100;stroke-opacity:1"
|
||||||
|
transform="matrix(-1.0000008,0,0,0.99998914,1920.5256,118.0489)"
|
||||||
|
inkscape:label="arrow1R"
|
||||||
|
id="arrow1R">
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 952.4036,47.432743 H 923.87395"
|
||||||
|
id="path511"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path513"
|
||||||
|
d="M 936.70791,32.6968 921.8587,47.4328"
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
style="fill:none;stroke:#bb6100;stroke-width:4.07999992;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="M 936.70791,62.1688 921.8587,47.4328"
|
||||||
|
id="path515"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cc" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
<g
|
<g
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="INITA"
|
id="INITA"
|
||||||
|
@ -1693,7 +2266,7 @@
|
||||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||||
y="187.10254"
|
y="187.10254"
|
||||||
x="399.48752"
|
x="399.48752"
|
||||||
id="tspan1079"
|
id="tspan339"
|
||||||
sodipodi:role="line">F</tspan></text>
|
sodipodi:role="line">F</tspan></text>
|
||||||
<text
|
<text
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
|
@ -1704,7 +2277,7 @@
|
||||||
transform="scale(0.991516,1.0085566)"
|
transform="scale(0.991516,1.0085566)"
|
||||||
inkscape:label="#text4244"><tspan
|
inkscape:label="#text4244"><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
id="tspan1082"
|
id="tspan342"
|
||||||
x="398.21817"
|
x="398.21817"
|
||||||
y="304.35275"
|
y="304.35275"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">S</tspan></text>
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">S</tspan></text>
|
||||||
|
@ -1719,7 +2292,7 @@
|
||||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:70px;line-height:1.25;font-family:BoeingCDULarge;-inkscape-font-specification:BoeingCDULarge;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||||
y="422.15305"
|
y="422.15305"
|
||||||
x="398.21817"
|
x="398.21817"
|
||||||
id="tspan1085"
|
id="tspan345"
|
||||||
sodipodi:role="line">O</tspan></text>
|
sodipodi:role="line">O</tspan></text>
|
||||||
<text
|
<text
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
|
@ -1730,7 +2303,7 @@
|
||||||
transform="scale(0.90642126,1.1032398)"
|
transform="scale(0.90642126,1.1032398)"
|
||||||
inkscape:label="#text4244"><tspan
|
inkscape:label="#text4244"><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
id="tspan1088"
|
id="tspan348"
|
||||||
x="478.87796"
|
x="478.87796"
|
||||||
y="171.04486"
|
y="171.04486"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">=</tspan></text>
|
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">=</tspan></text>
|
||||||
|
@ -1745,7 +2318,7 @@
|
||||||
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1"
|
||||||
y="278.32764"
|
y="278.32764"
|
||||||
x="478.87796"
|
x="478.87796"
|
||||||
id="tspan1091"
|
id="tspan351"
|
||||||
sodipodi:role="line">=</tspan></text>
|
sodipodi:role="line">=</tspan></text>
|
||||||
<text
|
<text
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
|
@ -1756,7 +2329,7 @@
|
||||||
transform="scale(0.90642126,1.1032398)"
|
transform="scale(0.90642126,1.1032398)"
|
||||||
inkscape:label="#text4244"><tspan
|
inkscape:label="#text4244"><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
id="tspan1094"
|
id="tspan354"
|
||||||
x="478.87796"
|
x="478.87796"
|
||||||
y="385.6102"
|
y="385.6102"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">=</tspan></text>
|
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:63.9924px;line-height:1.25;font-family:'Helvetica Medium';-inkscape-font-specification:'Helvetica Medium, Medium';text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1">=</tspan></text>
|
||||||
|
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 124 KiB |
|
@ -5,7 +5,7 @@
|
||||||
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
# Copyright (c) 2019 Joshua Davidson (Octal450)
|
||||||
|
|
||||||
var get_local_path = func(file){
|
var get_local_path = func(file){
|
||||||
var aircraft_dir = split("/", getprop("sim/aircraft-dir"))[-1];
|
var aircraft_dir = split("/", getprop("/sim/aircraft-dir"))[-1];
|
||||||
return "Aircraft/" ~ aircraft_dir ~ "/Models/Instruments/ND/canvas/"~ file;
|
return "Aircraft/" ~ aircraft_dir ~ "/Models/Instruments/ND/canvas/"~ file;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ var A3XXRouteDriver = {
|
||||||
me.update();
|
me.update();
|
||||||
},
|
},
|
||||||
update: func(){
|
update: func(){
|
||||||
me.flightplan = flightplan();
|
me.flightplan = fmgc.flightPlanController.flightplans[2];
|
||||||
},
|
},
|
||||||
getNumberOfFlightPlans: func(){1},
|
getNumberOfFlightPlans: func(){1},
|
||||||
getFlightPlanType: func(fpNum){"current"},
|
getFlightPlanType: func(fpNum){"current"},
|
||||||
|
@ -25,7 +25,17 @@ var A3XXRouteDriver = {
|
||||||
getWP: func(fpNum, idx){me.flightplan.getWP(idx)},
|
getWP: func(fpNum, idx){me.flightplan.getWP(idx)},
|
||||||
getPlanModeWP: func(plan_wp_idx){me.flightplan.getWP(plan_wp_idx)},
|
getPlanModeWP: func(plan_wp_idx){me.flightplan.getWP(plan_wp_idx)},
|
||||||
hasDiscontinuity: func(fpNum, wptID){0},
|
hasDiscontinuity: func(fpNum, wptID){0},
|
||||||
getListeners: func(){[]},
|
triggerSignal: func(signal){
|
||||||
|
setprop(me.signalPath(signal),1);
|
||||||
|
setprop(me.signalPath(signal),0);
|
||||||
|
},
|
||||||
|
signalPath: func(signal){
|
||||||
|
"autopilot/route-manager/signals/rd-"~ signal;
|
||||||
|
},
|
||||||
|
getListeners: func(){[
|
||||||
|
me.signalPath("fp-added"),
|
||||||
|
me.signalPath("fp-removed")
|
||||||
|
]},
|
||||||
shouldUpdate: func 1
|
shouldUpdate: func 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,7 +109,8 @@ var MultiA3XXRouteDriver = {
|
||||||
return fp.getWP(idx);
|
return fp.getWP(idx);
|
||||||
},
|
},
|
||||||
triggerSignal: func(signal){
|
triggerSignal: func(signal){
|
||||||
setprop(me.signalPath(signal));
|
setprop(me.signalPath(signal), 1);
|
||||||
|
setprop(me.signalPath(signal), 0);
|
||||||
},
|
},
|
||||||
signalPath: func(signal){
|
signalPath: func(signal){
|
||||||
"autopilot/route-manager/signals/rd-"~ signal;
|
"autopilot/route-manager/signals/rd-"~ signal;
|
||||||
|
|
|
@ -23,7 +23,7 @@ var SymbolPainter = {
|
||||||
},
|
},
|
||||||
getAircraftDir: func(){
|
getAircraftDir: func(){
|
||||||
if(me.aircraft_dir == nil)
|
if(me.aircraft_dir == nil)
|
||||||
me.aircraft_dir = split("/", getprop("sim/aircraft-dir"))[-1];
|
me.aircraft_dir = split("/", getprop("/sim/aircraft-dir"))[-1];
|
||||||
return me.aircraft_dir;
|
return me.aircraft_dir;
|
||||||
},
|
},
|
||||||
svgPath: func(file){
|
svgPath: func(file){
|
||||||
|
|
|
@ -13,7 +13,7 @@ setlistener("/nasal/canvas/loaded", func() {
|
||||||
####### LOAD FILES #######
|
####### LOAD FILES #######
|
||||||
#print("loading files");
|
#print("loading files");
|
||||||
(func {
|
(func {
|
||||||
var aircraft_root = getprop("sim/aircraft-dir");
|
var aircraft_root = getprop("/sim/aircraft-dir");
|
||||||
|
|
||||||
var load = func(file, name) {
|
var load = func(file, name) {
|
||||||
#print("Loading ..." ~ file);
|
#print("Loading ..." ~ file);
|
||||||
|
|
|
@ -12,9 +12,9 @@ SymbolLayer.add(name, {
|
||||||
type: name, # Symbol type
|
type: name, # Symbol type
|
||||||
df_controller: __self__, # controller to use by default -- this one
|
df_controller: __self__, # controller to use by default -- this one
|
||||||
df_options: { # default configuration options
|
df_options: { # default configuration options
|
||||||
active_node: "/autopilot/route-manager/active",
|
active_node: "/FMGC/flightplan[2]/active",
|
||||||
current_wp_node: "/autopilot/route-manager/current-wp",
|
current_wp_node: "/FMGC/flightplan[2]/current-wp",
|
||||||
wp_num: "/autopilot/route-manager/route/num",
|
wp_num: "/FMGC/flightplan[2]/num",
|
||||||
display_inactive_rte: 0
|
display_inactive_rte: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -74,12 +74,12 @@ var searchCmd = func {
|
||||||
path = [{},{lon:leg.wp_lon, lat:leg.wp_lat}];
|
path = [{},{lon:leg.wp_lon, lat:leg.wp_lat}];
|
||||||
else
|
else
|
||||||
path = leg.path();
|
path = leg.path();
|
||||||
if(i == (fpSize - 1) and !discontinuity){# WORKAROUND FOR FG BUG
|
# if(i == (fpSize - 1) and !discontinuity){# WORKAROUND FOR FG BUG -- we don't need it anymore (I think)!
|
||||||
var ltype = leg.wp_type;
|
# var ltype = leg.wp_type;
|
||||||
var path_l = size(path);
|
# var path_l = size(path);
|
||||||
if(ltype != 'runway' and path_l >= 2)
|
# if(ltype != 'runway' and path_l >= 2)
|
||||||
path = subvec(path, 0, 1) ~ subvec(path, path_l - 1, 1);
|
# path = subvec(path, 0, 1) ~ subvec(path, path_l - 1, 1);
|
||||||
}
|
# }
|
||||||
coords ~= path;
|
coords ~= path;
|
||||||
discontinuity = driver.hasDiscontinuity(idx, leg);
|
discontinuity = driver.hasDiscontinuity(idx, leg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ canvas.SymbolLayer.add(name, {
|
||||||
.close()
|
.close()
|
||||||
.setStrokeLineWidth(3)
|
.setStrokeLineWidth(3)
|
||||||
.setColor(1,1,1)
|
.setColor(1,1,1)
|
||||||
.setScale(1,1);
|
.setScale(1);
|
||||||
},
|
},
|
||||||
vor_symbol: 'Nasal/canvas/map/Airbus/Images/airbus_vor.svg',
|
vor_symbol: 'Nasal/canvas/map/Airbus/Images/airbus_vor.svg',
|
||||||
airport_symbol: 'Nasal/canvas/map/Airbus/Images/airbus_airport.svg',
|
airport_symbol: 'Nasal/canvas/map/Airbus/Images/airbus_airport.svg',
|
||||||
|
|
|
@ -58,16 +58,16 @@ var init = func {
|
||||||
var cstr_txt = "\n";
|
var cstr_txt = "\n";
|
||||||
if(alt > 0){
|
if(alt > 0){
|
||||||
if(alt > 10000)
|
if(alt > 10000)
|
||||||
cstr_txt ~= sprintf('FL%3.0f', int(alt / 100));
|
cstr_txt ~= sprintf('FL%3d', int(alt / 100));
|
||||||
else
|
else
|
||||||
cstr_txt ~= sprintf('%4.0f', int(alt));
|
cstr_txt ~= sprintf('%4d', int(alt));
|
||||||
}
|
}
|
||||||
if(spd > 0){
|
if(spd > 0){
|
||||||
if(alt > 0) cstr_txt ~= "\n";
|
if(alt > 0) cstr_txt ~= "\n";
|
||||||
if(spd <= 1)
|
if(spd <= 1)
|
||||||
cstr_txt ~= sprintf('%1.2fM', spd);
|
cstr_txt ~= sprintf('%4.2fM', spd);
|
||||||
else
|
else
|
||||||
cstr_txt ~= sprintf('%3.0fKT', int(spd));
|
cstr_txt ~= sprintf('%3dKT', int(spd));
|
||||||
}
|
}
|
||||||
me.text_alt = wp_group.createChild("text", "wp-alt-text-" ~ me.model.idx)
|
me.text_alt = wp_group.createChild("text", "wp-alt-text-" ~ me.model.idx)
|
||||||
.setDrawMode( canvas.Text.TEXT )
|
.setDrawMode( canvas.Text.TEXT )
|
||||||
|
@ -127,7 +127,7 @@ var draw = func{
|
||||||
}
|
}
|
||||||
if(me.model.is_departure or me.model.is_destination){
|
if(me.model.is_departure or me.model.is_destination){
|
||||||
var prop = (me.model.is_departure ? 'departure' : 'destination');
|
var prop = (me.model.is_departure ? 'departure' : 'destination');
|
||||||
var rwy = getprop("autopilot/route-manager/"~prop~"/runway");
|
var rwy = getprop("/autopilot/route-manager/"~prop~"/runway");
|
||||||
if(rwy != nil and size(rwy) > 0){
|
if(rwy != nil and size(rwy) > 0){
|
||||||
me.wp_sym.hide();
|
me.wp_sym.hide();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -46,12 +46,12 @@ canvas.NDStyles["Airbus"] = {
|
||||||
# that the lateral flight mode is managed.
|
# that the lateral flight mode is managed.
|
||||||
# You can easily override these options before creating the ND, example:
|
# You can easily override these options before creating the ND, example:
|
||||||
# canvas.NDStyles["Airbus"].options.defaults.fplan_active = "my/autpilot/f-plan/active"
|
# canvas.NDStyles["Airbus"].options.defaults.fplan_active = "my/autpilot/f-plan/active"
|
||||||
fplan_active: "autopilot/route-manager/active",
|
fplan_active: "/FMGC/flightplan[2]/active",
|
||||||
lat_ctrl: "/it-autoflight/output/lat",
|
lat_ctrl: "/it-autoflight/output/lat",
|
||||||
managed_val: 1,
|
managed_val: 1,
|
||||||
ver_ctrl: "/it-autoflight/output/vert",
|
ver_ctrl: "/it-autoflight/output/vert",
|
||||||
spd_ctrl: "/flight-management/control/spd-ctrl",
|
spd_ctrl: "/flight-management/control/spd-ctrl",
|
||||||
current_wp: "/autopilot/route-manager/current-wp",
|
current_wp: "/FMGC/flightplan[2]/current-wp",
|
||||||
ap1: "/it-autoflight/output/ap1",
|
ap1: "/it-autoflight/output/ap1",
|
||||||
ap2: "/it-autoflight/output/ap2",
|
ap2: "/it-autoflight/output/ap2",
|
||||||
nav1_frq: "/instrumentation/nav[0]/frequencies/selected-mhz",
|
nav1_frq: "/instrumentation/nav[0]/frequencies/selected-mhz",
|
||||||
|
@ -740,11 +740,11 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id: "wpActiveId",
|
id: "wpActiveId",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) getprop("autopilot/route-manager/wp/id") != nil and
|
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
|
||||||
getprop("autopilot/route-manager/active") and
|
getprop("FMGC/flightplan[2]/active") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.wpActiveId.setText(getprop("autopilot/route-manager/wp/id"));
|
nd.symbols.wpActiveId.setText(getprop("/FMGC/flightplan[2]/current-leg"));
|
||||||
nd.symbols.wpActiveId.show();
|
nd.symbols.wpActiveId.show();
|
||||||
},
|
},
|
||||||
is_false: func(nd) nd.symbols.wpActiveId.hide(),
|
is_false: func(nd) nd.symbols.wpActiveId.hide(),
|
||||||
|
@ -754,12 +754,16 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id: "wpActiveCrs",
|
id: "wpActiveCrs",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) getprop("autopilot/route-manager/wp/id") != nil and
|
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg") != nil and
|
||||||
getprop("autopilot/route-manager/active") and
|
getprop("FMGC/flightplan[2]/active") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
#var cur_wp = getprop("autopilot/route-manager/current-wp");
|
#var cur_wp = getprop("autopilot/route-manager/current-wp");
|
||||||
var deg = int(getprop("autopilot/route-manager/wp/bearing-deg"));
|
if (nd.get_switch("toggle_true_north")) {
|
||||||
|
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course"));
|
||||||
|
} else {
|
||||||
|
var deg = math.round(getprop("/FMGC/flightplan[2]/current-leg-course-mag"));
|
||||||
|
}
|
||||||
nd.symbols.wpActiveCrs.setText((deg or "")~"°");
|
nd.symbols.wpActiveCrs.setText((deg or "")~"°");
|
||||||
nd.symbols.wpActiveCrs.show();
|
nd.symbols.wpActiveCrs.show();
|
||||||
},
|
},
|
||||||
|
@ -770,11 +774,11 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id: "wpActiveDist",
|
id: "wpActiveDist",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) getprop("autopilot/route-manager/wp/dist") != nil and
|
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and
|
||||||
getprop("autopilot/route-manager/active") and
|
getprop("FMGC/flightplan[2]/active") and
|
||||||
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
var dst = getprop("autopilot/route-manager/wp/dist");
|
var dst = getprop("/FMGC/flightplan[2]/current-leg-dist");
|
||||||
nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst));
|
nd.symbols.wpActiveDist.setText(sprintf("%3.01f",dst));
|
||||||
nd.symbols.wpActiveDist.show();
|
nd.symbols.wpActiveDist.show();
|
||||||
},
|
},
|
||||||
|
@ -785,10 +789,10 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id: "wpActiveDistLbl",
|
id: "wpActiveDistLbl",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) getprop("autopilot/route-manager/wp/dist") != nil and getprop("autopilot/route-manager/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
predicate: func(nd) getprop("/FMGC/flightplan[2]/current-leg-dist") != nil and getprop("FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.wpActiveDistLbl.show();
|
nd.symbols.wpActiveDistLbl.show();
|
||||||
if(getprop("autopilot/route-manager/wp/dist") > 1000)
|
if(getprop("/FMGC/flightplan[2]/current-leg-dist") > 1000)
|
||||||
nd.symbols.wpActiveDistLbl.setText(" NM");
|
nd.symbols.wpActiveDistLbl.setText(" NM");
|
||||||
},
|
},
|
||||||
is_false: func(nd) nd.symbols.wpActiveDistLbl.hide(),
|
is_false: func(nd) nd.symbols.wpActiveDistLbl.hide(),
|
||||||
|
@ -798,7 +802,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id: "eta",
|
id: "eta",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("autopilot/route-manager/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
predicate: func(nd) getprop("autopilot/route-manager/wp/eta") != nil and getprop("FMGC/flightplan[2]/active") and nd.in_mode("toggle_display_mode", ["MAP", "PLAN"]),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
var etaSec = getprop("sim/time/utc/day-seconds")+
|
var etaSec = getprop("sim/time/utc/day-seconds")+
|
||||||
getprop("autopilot/route-manager/wp/eta-seconds");
|
getprop("autopilot/route-manager/wp/eta-seconds");
|
||||||
|
@ -1679,7 +1683,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
||||||
is_true: func(nd){
|
is_true: func(nd){
|
||||||
var active = getprop("autopilot/route-manager/active");
|
var active = getprop("FMGC/flightplan[2]/active");
|
||||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||||
var managed_v = nd.options.defaults.managed_val;
|
var managed_v = nd.options.defaults.managed_val;
|
||||||
var is_managed = (lat_ctrl == managed_v);
|
var is_managed = (lat_ctrl == managed_v);
|
||||||
|
@ -1708,7 +1712,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")),
|
||||||
is_true: func(nd){
|
is_true: func(nd){
|
||||||
var active = getprop("autopilot/route-manager/active");
|
var active = getprop("FMGC/flightplan[2]/active");
|
||||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||||
var managed_v = nd.options.defaults.managed_val;
|
var managed_v = nd.options.defaults.managed_val;
|
||||||
var is_managed = (lat_ctrl == managed_v);
|
var is_managed = (lat_ctrl == managed_v);
|
||||||
|
@ -1737,7 +1741,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
||||||
is_true: func(nd){
|
is_true: func(nd){
|
||||||
var active = getprop("autopilot/route-manager/active");
|
var active = getprop("FMGC/flightplan[2]/active");
|
||||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||||
var managed_v = nd.options.defaults.managed_val;
|
var managed_v = nd.options.defaults.managed_val;
|
||||||
var is_managed = (lat_ctrl == managed_v);
|
var is_managed = (lat_ctrl == managed_v);
|
||||||
|
@ -1766,7 +1770,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and nd.get_switch("toggle_centered")),
|
||||||
is_true: func(nd){
|
is_true: func(nd){
|
||||||
var active = getprop("autopilot/route-manager/active");
|
var active = getprop("FMGC/flightplan[2]/active");
|
||||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||||
var managed_v = nd.options.defaults.managed_val;
|
var managed_v = nd.options.defaults.managed_val;
|
||||||
var is_managed = (lat_ctrl == managed_v);
|
var is_managed = (lat_ctrl == managed_v);
|
||||||
|
@ -1795,7 +1799,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["MAP", "PLAN"])),
|
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["MAP", "PLAN"])),
|
||||||
is_true: func(nd){
|
is_true: func(nd){
|
||||||
var active = getprop("autopilot/route-manager/active");
|
var active = getprop("FMGC/flightplan[2]/active");
|
||||||
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
var lat_ctrl = getprop(nd.options.defaults.lat_ctrl);
|
||||||
var managed_v = nd.options.defaults.managed_val;
|
var managed_v = nd.options.defaults.managed_val;
|
||||||
var is_managed = (lat_ctrl == managed_v);
|
var is_managed = (lat_ctrl == managed_v);
|
||||||
|
|
|
@ -48,10 +48,10 @@ var Radio = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var FPLN = {
|
var FPLN = {
|
||||||
active: props.globals.getNode("autopilot/route-manager/active", 1),
|
active: props.globals.getNode("/FMGC/flightplan[2]/active", 1),
|
||||||
activeTemp: 0,
|
activeTemp: 0,
|
||||||
currentCourse: 0,
|
currentCourse: 0,
|
||||||
currentWP: props.globals.getNode("autopilot/route-manager/current-wp", 1),
|
currentWP: props.globals.getNode("/FMGC/flightplan[2]/current-wp", 1),
|
||||||
currentWPTemp: 0,
|
currentWPTemp: 0,
|
||||||
deltaAngle: 0,
|
deltaAngle: 0,
|
||||||
deltaAngleRad: 0,
|
deltaAngleRad: 0,
|
||||||
|
@ -59,12 +59,10 @@ var FPLN = {
|
||||||
maxBank: 0,
|
maxBank: 0,
|
||||||
maxBankLimit: 0,
|
maxBankLimit: 0,
|
||||||
nextCourse: 0,
|
nextCourse: 0,
|
||||||
num: props.globals.getNode("autopilot/route-manager/route/num", 1),
|
|
||||||
numTemp: 0,
|
|
||||||
R: 0,
|
R: 0,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
turnDist: 0,
|
turnDist: 0,
|
||||||
wp0Dist: props.globals.getNode("autopilot/route-manager/wp/dist", 1),
|
wp0Dist: props.globals.getNode("/FMGC/flightplan[2]/current-leg-dist", 1),
|
||||||
wpFlyFrom: 0,
|
wpFlyFrom: 0,
|
||||||
wpFlyTo: 0,
|
wpFlyTo: 0,
|
||||||
};
|
};
|
||||||
|
@ -376,7 +374,6 @@ var ITAF = {
|
||||||
Velocity.trueAirspeedKtTemp = Velocity.trueAirspeedKt.getValue();
|
Velocity.trueAirspeedKtTemp = Velocity.trueAirspeedKt.getValue();
|
||||||
FPLN.activeTemp = FPLN.active.getValue();
|
FPLN.activeTemp = FPLN.active.getValue();
|
||||||
FPLN.currentWPTemp = FPLN.currentWP.getValue();
|
FPLN.currentWPTemp = FPLN.currentWP.getValue();
|
||||||
FPLN.numTemp = FPLN.num.getValue();
|
|
||||||
|
|
||||||
# Bank Limit
|
# Bank Limit
|
||||||
if (Velocity.trueAirspeedKtTemp >= 420) {
|
if (Velocity.trueAirspeedKtTemp >= 420) {
|
||||||
|
@ -391,25 +388,25 @@ var ITAF = {
|
||||||
|
|
||||||
# If in LNAV mode and route is not longer active, switch to HDG HLD
|
# If in LNAV mode and route is not longer active, switch to HDG HLD
|
||||||
if (Output.lat.getValue() == 1) { # Only evaulate the rest of the condition if we are in LNAV mode
|
if (Output.lat.getValue() == 1) { # Only evaulate the rest of the condition if we are in LNAV mode
|
||||||
if (FPLN.num.getValue() == 0 or !FPLN.active.getBoolValue()) {
|
if (flightPlanController.num[2].getValue() == 0 or !FPLN.active.getBoolValue()) {
|
||||||
me.setLatMode(3);
|
me.setLatMode(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Waypoint Advance Logic
|
# Waypoint Advance Logic
|
||||||
if (FPLN.numTemp > 0 and FPLN.activeTemp == 1) {
|
if (flightPlanController.num[2].getValue() > 0 and FPLN.activeTemp == 1) {
|
||||||
if ((FPLN.currentWPTemp + 1) < FPLN.numTemp) {
|
if ((FPLN.currentWPTemp + 1) < flightPlanController.num[2].getValue()) {
|
||||||
Velocity.groundspeedMps = Velocity.groundspeedKt.getValue() * 0.5144444444444;
|
Velocity.groundspeedMps = Velocity.groundspeedKt.getValue() * 0.5144444444444;
|
||||||
FPLN.wpFlyFrom = FPLN.currentWPTemp;
|
FPLN.wpFlyFrom = FPLN.currentWPTemp;
|
||||||
if (FPLN.wpFlyFrom < 0) {
|
if (FPLN.wpFlyFrom < 0) {
|
||||||
FPLN.wpFlyFrom = 0;
|
FPLN.wpFlyFrom = 0;
|
||||||
}
|
}
|
||||||
FPLN.currentCourse = getprop("autopilot/route-manager/route/wp[" ~ FPLN.wpFlyFrom ~ "]/leg-bearing-true-deg"); # Best left at getprop
|
FPLN.currentCourse = getprop("/FMGC/flightplan[2]/wp[" ~ FPLN.wpFlyFrom ~ "]/course"); # Best left at getprop
|
||||||
FPLN.wpFlyTo = FPLN.currentWPTemp + 1;
|
FPLN.wpFlyTo = FPLN.currentWPTemp + 1;
|
||||||
if (FPLN.wpFlyTo < 0) {
|
if (FPLN.wpFlyTo < 0) {
|
||||||
FPLN.wpFlyTo = 0;
|
FPLN.wpFlyTo = 0;
|
||||||
}
|
}
|
||||||
FPLN.nextCourse = getprop("autopilot/route-manager/route/wp[" ~ FPLN.wpFlyTo ~ "]/leg-bearing-true-deg"); # Best left at getprop
|
FPLN.nextCourse = getprop("/FMGC/flightplan[2]/wp[" ~ FPLN.wpFlyTo ~ "]/course"); # Best left at getprop
|
||||||
FPLN.maxBankLimit = Internal.bankLimit.getValue();
|
FPLN.maxBankLimit = Internal.bankLimit.getValue();
|
||||||
|
|
||||||
FPLN.deltaAngle = math.abs(geo.normdeg180(FPLN.currentCourse - FPLN.nextCourse));
|
FPLN.deltaAngle = math.abs(geo.normdeg180(FPLN.currentCourse - FPLN.nextCourse));
|
||||||
|
@ -431,7 +428,11 @@ var ITAF = {
|
||||||
Internal.lnavAdvanceNm.setValue(FPLN.turnDist);
|
Internal.lnavAdvanceNm.setValue(FPLN.turnDist);
|
||||||
|
|
||||||
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist) {
|
if (FPLN.wp0Dist.getValue() <= FPLN.turnDist) {
|
||||||
FPLN.currentWP.setValue(FPLN.currentWPTemp + 1);
|
if (flightPlanController.currentToWptIndex.getValue() < 1) {
|
||||||
|
flightPlanController.currentToWptIndex.setValue(1);
|
||||||
|
} else if (flightPlanController.num[2].getValue() > 2) { # The Airbus doesn't display anything past the previous waypoint after advancing
|
||||||
|
flightPlanController.autoSequencing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -600,7 +601,7 @@ var ITAF = {
|
||||||
Custom.showHdg.setBoolValue(1);
|
Custom.showHdg.setBoolValue(1);
|
||||||
me.armTextCheck();
|
me.armTextCheck();
|
||||||
} else if (n == 1) {
|
} else if (n == 1) {
|
||||||
if (FPLN.num.getValue() > 0 and FPLN.active.getBoolValue()) {
|
if (flightPlanController.num[2].getValue() > 0 and FPLN.active.getBoolValue()) {
|
||||||
Output.lnavArm.setBoolValue(1);
|
Output.lnavArm.setBoolValue(1);
|
||||||
Custom.showHdg.setBoolValue(0);
|
Custom.showHdg.setBoolValue(0);
|
||||||
me.armTextCheck();
|
me.armTextCheck();
|
||||||
|
@ -647,7 +648,10 @@ var ITAF = {
|
||||||
Text.vert.setValue("ALT CAP");
|
Text.vert.setValue("ALT CAP");
|
||||||
} else if (n == 4) { # FLCH
|
} else if (n == 4) { # FLCH
|
||||||
Output.apprArm.setBoolValue(0);
|
Output.apprArm.setBoolValue(0);
|
||||||
if (abs(Input.altDiff) >= 125) { # SPD CLB or SPD DES
|
Output.vert.setValue(1);
|
||||||
|
Internal.alt.setValue(Input.alt.getValue());
|
||||||
|
Internal.altDiff = Internal.alt.getValue() - Position.indicatedAltitudeFt.getValue();
|
||||||
|
if (abs(Internal.altDiff) >= 250) { # SPD CLB or SPD DES
|
||||||
if (Input.alt.getValue() >= Position.indicatedAltitudeFt.getValue()) { # Usually set Thrust Mode Selector, but we do it now due to timer lag
|
if (Input.alt.getValue() >= Position.indicatedAltitudeFt.getValue()) { # Usually set Thrust Mode Selector, but we do it now due to timer lag
|
||||||
Text.vert.setValue("SPD CLB");
|
Text.vert.setValue("SPD CLB");
|
||||||
} else {
|
} else {
|
||||||
|
@ -734,7 +738,7 @@ var ITAF = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkLNAV: func(t) {
|
checkLNAV: func(t) {
|
||||||
if (FPLN.num.getValue() > 0 and FPLN.active.getBoolValue() and Position.gearAglFt.getValue() >= 30) {
|
if (flightPlanController.num[2].getValue() > 0 and FPLN.active.getBoolValue() and Position.gearAglFt.getValue() >= 30) {
|
||||||
me.activateLNAV();
|
me.activateLNAV();
|
||||||
} else if (Output.lat.getValue() != 1 and t != 1) {
|
} else if (Output.lat.getValue() != 1 and t != 1) {
|
||||||
Output.lnavArm.setBoolValue(1);
|
Output.lnavArm.setBoolValue(1);
|
||||||
|
|
|
@ -148,24 +148,6 @@ var trimReset = func {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
###############
|
|
||||||
# MCDU Inputs #
|
|
||||||
###############
|
|
||||||
|
|
||||||
var updateARPT = func {
|
|
||||||
dep = getprop("FMGC/internal/dep-arpt");
|
|
||||||
arr = getprop("FMGC/internal/arr-arpt");
|
|
||||||
setprop("autopilot/route-manager/departure/airport", dep);
|
|
||||||
setprop("autopilot/route-manager/destination/airport", arr);
|
|
||||||
if (getprop("autopilot/route-manager/active") != 1) {
|
|
||||||
fgcommand("activate-flightplan", props.Node.new({"activate": 1}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setlistener("/FMGC/internal/cruise-ft", func {
|
|
||||||
setprop("autopilot/route-manager/cruise/altitude-ft", getprop("FMGC/internal/cruise-ft"));
|
|
||||||
});
|
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Flight Phase and Various #
|
# Flight Phase and Various #
|
||||||
############################
|
############################
|
||||||
|
@ -248,10 +230,10 @@ var masterFMGC = maketimer(0.2, func {
|
||||||
setprop("FMGC/status/phase", "5");
|
setprop("FMGC/status/phase", "5");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getprop("autopilot/route-manager/route/num") > 0 and getprop("autopilot/route-manager/active") == 1 and getprop("autopilot/route-manager/distance-remaining-nm") <= 15) {
|
if (flightPlanController.num[2].getValue() > 0 and getprop("/FMGC/flightplan[2]/active") == 1 and flightPlanController.arrivalDist <= 15) {
|
||||||
setprop("FMGC/internal/decel", 1);
|
setprop("/FMGC/internal/decel", 1);
|
||||||
} else if (getprop("FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) {
|
} else if (getprop("/FMGC/internal/decel") == 1 and (phase == 0 or phase == 6)) {
|
||||||
setprop("FMGC/internal/decel", 0);
|
setprop("/FMGC/internal/decel", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phase == "5" and state1 == "TOGA" and state2 == "TOGA") {
|
if (phase == "5" and state1 == "TOGA" and state2 == "TOGA") {
|
||||||
|
@ -304,6 +286,7 @@ var reset_FMGC = func {
|
||||||
alt = getprop("it-autoflight/input/alt");
|
alt = getprop("it-autoflight/input/alt");
|
||||||
ITAF.init();
|
ITAF.init();
|
||||||
FMGCinit();
|
FMGCinit();
|
||||||
|
flightPlanController.reset();
|
||||||
mcdu.MCDU_reset(0);
|
mcdu.MCDU_reset(0);
|
||||||
mcdu.MCDU_reset(1);
|
mcdu.MCDU_reset(1);
|
||||||
setprop("it-autoflight/input/fd1", fd1);
|
setprop("it-autoflight/input/fd1", fd1);
|
||||||
|
|
551
Nasal/FMGC/flightplan.nas
Normal file
551
Nasal/FMGC/flightplan.nas
Normal file
|
@ -0,0 +1,551 @@
|
||||||
|
# A3XX FMGC Flightplan Driver
|
||||||
|
# Copyright (c) 2019 Jonathan Redpath (2019)
|
||||||
|
|
||||||
|
var wpDep = nil;
|
||||||
|
var wpArr = nil;
|
||||||
|
var pos = nil;
|
||||||
|
var geoPosPrev = geo.Coord.new();
|
||||||
|
var currentLegCourseDist = nil;
|
||||||
|
var courseDistanceFrom = nil;
|
||||||
|
var courseDistanceFromPrev = nil;
|
||||||
|
var sizeWP = nil;
|
||||||
|
var magTrueError = 0;
|
||||||
|
|
||||||
|
# Props.getNode
|
||||||
|
var magHDG = props.globals.getNode("/orientation/heading-magnetic-deg", 1);
|
||||||
|
var trueHDG = props.globals.getNode("/orientation/heading-deg", 1);
|
||||||
|
var FMGCdep = props.globals.getNode("/FMGC/internal/dep-arpt", 1);
|
||||||
|
var FMGCarr = props.globals.getNode("/FMGC/internal/arr-arpt", 1);
|
||||||
|
var toFromSet = props.globals.getNode("/FMGC/internal/tofrom-set", 1);
|
||||||
|
|
||||||
|
# Props.initNode
|
||||||
|
var wpID = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/id", "", "STRING")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/id", "", "STRING")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/id", "", "STRING")]];
|
||||||
|
var wpLat = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/lat", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lat", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/lat", 0, "DOUBLE")]];
|
||||||
|
var wpLon = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/lon", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/lon", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/lon", 0, "DOUBLE")]];
|
||||||
|
var wpCourse = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/course", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/course", 0, "DOUBLE")]];
|
||||||
|
var wpDistance = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/distance", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/distance", 0, "DOUBLE")]];
|
||||||
|
var wpCoursePrev = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/course-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/course-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/course-from-prev", 0, "DOUBLE")]];
|
||||||
|
var wpDistancePrev = [[props.globals.initNode("/FMGC/flightplan[0]/wp[0]/distance-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[1]/wp[0]/distance-from-prev", 0, "DOUBLE")], [props.globals.initNode("/FMGC/flightplan[2]/wp[0]/distance-from-prev", 0, "DOUBLE")]];
|
||||||
|
|
||||||
|
var flightPlanController = {
|
||||||
|
flightplans: [createFlightplan(), createFlightplan(), createFlightplan()],
|
||||||
|
temporaryFlag: [0, 0],
|
||||||
|
|
||||||
|
# These flags are only for the main flgiht-plan
|
||||||
|
active: props.globals.initNode("/FMGC/flightplan[2]/active", 0, "BOOL"),
|
||||||
|
|
||||||
|
currentToWpt: nil, # container for the current TO waypoint ghost
|
||||||
|
currentToWptIndex: props.globals.initNode("/FMGC/flightplan[2]/current-wp", 0, "INT"),
|
||||||
|
currentToWptID: props.globals.initNode("/FMGC/flightplan[2]/current-leg", "", "STRING"),
|
||||||
|
courseToWpt: props.globals.initNode("/FMGC/flightplan[2]/current-leg-course", 0, "DOUBLE"),
|
||||||
|
courseMagToWpt: props.globals.initNode("/FMGC/flightplan[2]/current-leg-course-mag", 0, "DOUBLE"),
|
||||||
|
distToWpt: props.globals.initNode("/FMGC/flightplan[2]/current-leg-dist", 0, "DOUBLE"),,
|
||||||
|
|
||||||
|
distanceToDest: [0, 0, 0],
|
||||||
|
num: [props.globals.initNode("/FMGC/flightplan[0]/num", 0, "INT"), props.globals.initNode("/FMGC/flightplan[1]/num", 0, "INT"), props.globals.initNode("/FMGC/flightplan[2]/num", 0, "INT")],
|
||||||
|
arrivalIndex: [0, 0, 0],
|
||||||
|
arrivalDist: 0,
|
||||||
|
_arrivalDist: 0,
|
||||||
|
fromWptTime: nil,
|
||||||
|
fromWptAlt: nil,
|
||||||
|
_timeTemp: nil,
|
||||||
|
_altTemp: nil,
|
||||||
|
|
||||||
|
reset: func() {
|
||||||
|
me.temporaryFlag[0] = 0;
|
||||||
|
me.temporaryFlag[1] = 0;
|
||||||
|
me.resetFlightplan(0);
|
||||||
|
me.resetFlightplan(1);
|
||||||
|
me.resetFlightplan(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
resetFlightplan: func(n) {
|
||||||
|
me.flightplans[n].cleanPlan();
|
||||||
|
me.flightplans[n].departure = nil;
|
||||||
|
me.flightplans[n].destination = nil;
|
||||||
|
},
|
||||||
|
|
||||||
|
createTemporaryFlightPlan: func(n) {
|
||||||
|
me.resetFlightplan(n);
|
||||||
|
me.flightplans[n] = me.flightplans[2].clone();
|
||||||
|
me.temporaryFlag[n] = 1;
|
||||||
|
if (canvas_mcdu.myDirTo[n] != nil) {
|
||||||
|
canvas_mcdu.myDirTo[n].updateTmpy();
|
||||||
|
}
|
||||||
|
me.flightPlanChanged(n);
|
||||||
|
},
|
||||||
|
|
||||||
|
destroyTemporaryFlightPlan: func(n, a) { # a = 1 activate, a = 0 erase
|
||||||
|
if (a == 1) {
|
||||||
|
flightPlanTimer.stop();
|
||||||
|
me.resetFlightplan(2);
|
||||||
|
me.flightplans[2] = me.flightplans[n].clone();
|
||||||
|
me.flightPlanChanged(2);
|
||||||
|
flightPlanTimer.start();
|
||||||
|
}
|
||||||
|
me.resetFlightplan(n);
|
||||||
|
me.temporaryFlag[n] = 0;
|
||||||
|
if (canvas_mcdu.myDirTo[n] != nil) {
|
||||||
|
canvas_mcdu.myDirTo[n].updateTmpy();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
updateAirports: func(dep, arr, plan) {
|
||||||
|
me.resetFlightplan(plan);
|
||||||
|
me.flightplans[plan].departure = airportinfo(dep);
|
||||||
|
me.flightplans[plan].destination = airportinfo(arr);
|
||||||
|
if (plan == 2) {
|
||||||
|
me.currentToWptIndex.setValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
me.addDiscontinuity(1, plan);
|
||||||
|
#todo if plan = 2, kill any tmpy flightplan
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
},
|
||||||
|
|
||||||
|
autoSequencing: func() {
|
||||||
|
me._timeTemp = math.round(getprop("/sim/time/utc/minute") + (getprop("/sim/time/utc/second") / 60));
|
||||||
|
if (me._timeTemp < 10) {
|
||||||
|
me._timeTemp = "0" ~ me._timeTemp;
|
||||||
|
}
|
||||||
|
me.fromWptTime = getprop("/sim/time/utc/hour") ~ me._timeTemp;
|
||||||
|
me._altTemp = getprop("/systems/navigation/adr/output/baro-alt-corrected-1-capt");
|
||||||
|
|
||||||
|
if (me._altTemp > getprop("FMGC/internal/trans-alt")) {
|
||||||
|
me.fromWptAlt = "FL" ~ math.round(me._altTemp / 100);
|
||||||
|
} else {
|
||||||
|
if (me._altTemp > 0) {
|
||||||
|
me.fromWptAlt = math.round(me._altTemp);
|
||||||
|
} else {
|
||||||
|
me.fromWptAlt = "M" ~ math.round(me._altTemp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# todo setlistener on sim/time/warp to recompute predictions
|
||||||
|
if (me.num[2].getValue() > 2) {
|
||||||
|
if (me.temporaryFlag[0] == 1 and wpID[0][0] == wpID[2][0]) {
|
||||||
|
me.deleteWP(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.temporaryFlag[1] == 1 and wpID[1][0] == wpID[2][0]) {
|
||||||
|
me.deleteWP(0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
me.deleteWP(0, 2, 0, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
# for these two remember to call flightPlanChanged
|
||||||
|
addDiscontinuity: func(index, plan) {
|
||||||
|
if (index > 0) {
|
||||||
|
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY" and me.flightplans[plan].getWP(index - 1).wp_name != "DISCONTINUITY") {
|
||||||
|
me.flightplans[plan].insertWP(createDiscontinuity(), index);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.flightplans[plan].getWP(index).wp_name != "DISCONTINUITY") {
|
||||||
|
me.flightplans[plan].insertWP(createDiscontinuity(), index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
insertPPOS: func(n) {
|
||||||
|
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "PPOS"), 0);
|
||||||
|
},
|
||||||
|
|
||||||
|
insertTP: func(n) {
|
||||||
|
me.flightplans[n].insertWP(createWP(geo.aircraft_position(), "T-P"), 1);
|
||||||
|
},
|
||||||
|
|
||||||
|
directTo: func(waypointGhost, plan) {
|
||||||
|
if (me.flightplans[plan].indexOfWP(waypointGhost) == -1) {
|
||||||
|
me.insertTP(plan);
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(waypointGhost), 2);
|
||||||
|
me.addDiscontinuity(3, plan);
|
||||||
|
me.deleteWP(0, plan);
|
||||||
|
} else {
|
||||||
|
var timesToDelete = me.flightplans[plan].indexOfWP(waypointGhost); # delete four times, so on last iteration it equals one and then goes to zero, leave it without subtracting one
|
||||||
|
while (timesToDelete > 1) {
|
||||||
|
me.deleteWP(1, plan, 1);
|
||||||
|
timesToDelete -= 1;
|
||||||
|
}
|
||||||
|
me.insertTP(plan);
|
||||||
|
# we want to delete the intermediate waypoints up to but not including the waypoint. Leave index 0, we delete it later.
|
||||||
|
# example - waypoint dirto is index 5, we want to delete indexes 1 -> 4. 5 - 1 = 4.
|
||||||
|
# so four individual deletions. Delete index 1 four times.
|
||||||
|
}
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
var curAircraftPosDirTo = geo.aircraft_position();
|
||||||
|
canvas_mcdu.myDirTo[plan].updateDist(me.flightplans[plan].getWP(1).courseAndDistanceFrom(curAircraftPosDirTo)[1]);
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteWP: func(index, n, a = 0, s = 0) { # a = 1, means adding a waypoint via deleting intermediate. s = 1, means autosequencing
|
||||||
|
var wp = wpID[n][index].getValue();
|
||||||
|
if (((s == 0 and left(wp, 4) != FMGCdep.getValue() and left(wp, 4) != FMGCarr.getValue()) or (s == 1)) and me.flightplans[n].getPlanSize() > 2) {
|
||||||
|
if (me.flightplans[n].getWP(index).id != "DISCONTINUITY" and a == 0) { # if it is a discont, don't make a new one
|
||||||
|
me.flightplans[n].deleteWP(index);
|
||||||
|
if (me.flightplans[n].getWP(index) != nil and s == 0) {
|
||||||
|
if (me.flightplans[n].getWP(index).id != "DISCONTINUITY") { # else, if the next one isn't a discont, add one
|
||||||
|
me.addDiscontinuity(index, n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.flightplans[n].deleteWP(index);
|
||||||
|
}
|
||||||
|
me.flightPlanChanged(n);
|
||||||
|
canvas_nd.A3XXRouteDriver.triggerSignal("fp-removed");
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
insertAirport: func(text, index, plan, override = 0, overrideIndex = -1) {
|
||||||
|
if (index == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var airport = findAirportsByICAO(text);
|
||||||
|
if (size(airport) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(airport) == 1 or override) {
|
||||||
|
if (!override) {
|
||||||
|
if (me.flightplans[plan].indexOfWP(airport[0]) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(airport[0]), index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(airport[0]) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.flightplans[plan].indexOfWP(airport[overrideIndex]) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(airport[overrideIndex]), index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(airport[overrideIndex]) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elsif (size(airport) >= 1) {
|
||||||
|
if (canvas_mcdu.myDuplicate[plan] != nil) {
|
||||||
|
canvas_mcdu.myDuplicate[plan].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDuplicate[plan] = nil;
|
||||||
|
canvas_mcdu.myDuplicate[plan] = mcdu.duplicateNamesPage.new(airport, index, 0, plan);
|
||||||
|
setprop("MCDU[" ~ plan ~ "]/page", "DUPLICATENAMES");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
insertFix: func(text, index, plan, override = 0, overrideIndex = -1) { # override - means always choose [0]
|
||||||
|
if (index == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var fix = findFixesByID(text);
|
||||||
|
if (size(fix) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(fix) == 1 or override) {
|
||||||
|
if (!override) {
|
||||||
|
if (me.flightplans[plan].indexOfWP(fix[0]) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(fix[0]), index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(fix[0]) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.flightplans[plan].indexOfWP(fix[overrideIndex]) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(fix[overrideIndex]), index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(fix[overrideIndex]) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elsif (size(fix) >= 1) {
|
||||||
|
if (canvas_mcdu.myDuplicate[plan] != nil) {
|
||||||
|
canvas_mcdu.myDuplicate[plan].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDuplicate[plan] = nil;
|
||||||
|
canvas_mcdu.myDuplicate[plan] = mcdu.duplicateNamesPage.new(fix, index, 0, plan);
|
||||||
|
setprop("MCDU[" ~ plan ~ "]/page", "DUPLICATENAMES");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
insertLatLonFix: func(text, index, plan) {
|
||||||
|
if (index == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var lat = split("/", text)[0];
|
||||||
|
var lon = split("/", text)[1];
|
||||||
|
var latDecimal = mcdu.stringToDegrees(lat, "lat");
|
||||||
|
var lonDecimal = mcdu.stringToDegrees(lon, "lon");
|
||||||
|
|
||||||
|
if (latDecimal > 90 or latDecimal < -90 or lonDecimal > 180 or lonDecimal < -180) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var myWpLatLon = createWP(latDecimal, lonDecimal, "LL" ~ index);
|
||||||
|
if (me.flightplans[plan].indexOfWP(myWpLatLon) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(myWpLatLon, index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(myWpLatLon) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
insertNavaid: func(text, index, plan, override = 0, overrideIndex = -1) {
|
||||||
|
if (index == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var navaid = findNavaidsByID(text);
|
||||||
|
if (size(navaid) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(navaid) == 1 or override) {
|
||||||
|
if (!override) {
|
||||||
|
if (me.flightplans[plan].indexOfWP(navaid[0]) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(navaid[0]), index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(navaid[0]) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.flightplans[plan].indexOfWP(navaid[overrideIndex]) == -1) {
|
||||||
|
me.flightplans[plan].insertWP(createWPFrom(navaid[overrideIndex]), index);
|
||||||
|
me.addDiscontinuity(index + 1, plan);
|
||||||
|
me.flightPlanChanged(plan);
|
||||||
|
return 2;
|
||||||
|
} else {
|
||||||
|
var numToDel = me.flightplans[plan].indexOfWP(navaid[overrideIndex]) - index;
|
||||||
|
while (numToDel > 0) {
|
||||||
|
me.deleteWP(index, plan, 1);
|
||||||
|
numToDel -= 1;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elsif (size(navaid) >= 1) {
|
||||||
|
if (canvas_mcdu.myDuplicate[plan] != nil) {
|
||||||
|
canvas_mcdu.myDuplicate[plan].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDuplicate[plan] = nil;
|
||||||
|
canvas_mcdu.myDuplicate[plan] = mcdu.duplicateNamesPage.new(navaid, index, 1, plan);
|
||||||
|
setprop("MCDU[" ~ plan ~ "]/page", "DUPLICATENAMES");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
scratchpad: func(text, index, plan) { # return 0 not in database, 1 not allowed, 2 success, 3 = not allowed due to dir to
|
||||||
|
if (mcdu.dirToFlag) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[plan]) {
|
||||||
|
if (text == "CLR" and me.flightplans[2].getWP(index).wp_name == "DISCONTINUITY") {
|
||||||
|
var thePlan = 2;
|
||||||
|
} else {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(plan);
|
||||||
|
var thePlan = plan;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var thePlan = plan;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text == "CLR") {
|
||||||
|
return me.deleteWP(index, thePlan, 0);
|
||||||
|
} elsif (size(text) == 16) {
|
||||||
|
return me.insertLatLonFix(text, index, thePlan);
|
||||||
|
} elsif (size(text) == 5) {
|
||||||
|
return me.insertFix(text, index, thePlan);
|
||||||
|
} elsif (size(text) == 4) {
|
||||||
|
return me.insertAirport(text, index, thePlan);
|
||||||
|
} elsif (size(text) == 3 or size(text) == 2) {
|
||||||
|
return me.insertNavaid(text, index, thePlan);
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
flightPlanChanged: func(n) {
|
||||||
|
sizeWP = size(wpID[n]);
|
||||||
|
for (var counter = sizeWP; counter < me.flightplans[n].getPlanSize(); counter += 1) { # create new properties if they are required
|
||||||
|
append(wpID[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/text", "", "STRING"));
|
||||||
|
append(wpLat[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/lat", 0, "DOUBLE"));
|
||||||
|
append(wpLon[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/lon", 0, "DOUBLE"));
|
||||||
|
append(wpCourse[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/course", 0, "DOUBLE"));
|
||||||
|
append(wpDistance[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/distance", 0, "DOUBLE"));
|
||||||
|
append(wpCoursePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/course-from-prev", 0, "DOUBLE"));
|
||||||
|
append(wpDistancePrev[n], props.globals.initNode("/FMGC/flightplan[" ~ n ~ "]/wp[" ~ counter ~ "]/distance-from-prev", 0, "DOUBLE"));
|
||||||
|
}
|
||||||
|
me.updatePlans();
|
||||||
|
canvas_nd.A3XXRouteDriver.triggerSignal("fp-added");
|
||||||
|
},
|
||||||
|
|
||||||
|
updatePlans: func() {
|
||||||
|
me.updateCurrentWaypoint();
|
||||||
|
me._arrivalDist = 0;
|
||||||
|
for (var n = 0; n <= 2; n += 1) {
|
||||||
|
for (var wpt = 0; wpt < me.flightplans[n].getPlanSize(); wpt += 1) { # Iterate through the waypoints and update their data
|
||||||
|
var curAircraftPos = geo.aircraft_position(); # don't want to get this corrupted so make sure it is a local variable
|
||||||
|
var waypointHashStore = me.flightplans[n].getWP(wpt);
|
||||||
|
|
||||||
|
courseDistanceFrom = waypointHashStore.courseAndDistanceFrom(curAircraftPos);
|
||||||
|
wpID[n][wpt].setValue(waypointHashStore.wp_name);
|
||||||
|
wpLat[n][wpt].setValue(waypointHashStore.wp_lat);
|
||||||
|
wpLon[n][wpt].setValue(waypointHashStore.wp_lon);
|
||||||
|
|
||||||
|
wpCourse[n][wpt].setValue(waypointHashStore.courseAndDistanceFrom(curAircraftPos)[0]);
|
||||||
|
wpDistance[n][wpt].setValue(waypointHashStore.courseAndDistanceFrom(curAircraftPos)[1]);
|
||||||
|
|
||||||
|
if (wpt == 1) {
|
||||||
|
if (me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
|
||||||
|
me._arrivalDist += courseDistanceFrom[1]; # distance to next waypoint, therafter to end of flightplan
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (left(wpID[n][wpt].getValue(), 4) == FMGCarr.getValue() and wpt != 0) {
|
||||||
|
if (me.arrivalIndex[n] != wpt) {
|
||||||
|
me.arrivalIndex[n] = wpt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wpt > 0) {
|
||||||
|
geoPosPrev.set_latlon(me.flightplans[n].getWP(wpt - 1).lat, me.flightplans[n].getWP(wpt - 1).lon);
|
||||||
|
|
||||||
|
courseDistanceFromPrev = waypointHashStore.courseAndDistanceFrom(geoPosPrev);
|
||||||
|
wpCoursePrev[n][wpt].setValue(courseDistanceFromPrev[0]);
|
||||||
|
wpDistancePrev[n][wpt].setValue(courseDistanceFromPrev[1]);
|
||||||
|
if (wpt > 1) {
|
||||||
|
if (me.flightplans[n].getWP(wpt - 1).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt).wp_name != "DISCONTINUITY" and me.flightplans[n].getWP(wpt - 1).wp_type != "vectors" and me.flightplans[n].getWP(wpt - 1).wp_type != "hdgToAlt" and me.flightplans[n].getWP(wpt).wp_type != "vectors" and me.flightplans[n].getWP(wpt).wp_type != "hdgToAlt" and wpt <= me.arrivalIndex[n]) {
|
||||||
|
me._arrivalDist += courseDistanceFromPrev[1]; # todo - buggy. Neglect discontinuity
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# use PPOS for the first waypoint
|
||||||
|
wpCoursePrev[n][wpt].setValue(courseDistanceFrom[0]);
|
||||||
|
wpDistancePrev[n][wpt].setValue(courseDistanceFrom[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (left(wpID[n][wpt].getValue(), 4) == FMGCarr.getValue() and wpt != 0) {
|
||||||
|
if (me.arrivalIndex[n] != wpt) { # don't merge line 397 and 398 if statements
|
||||||
|
if (canvas_mcdu.myFpln[0] != nil) {
|
||||||
|
canvas_mcdu.myFpln[0].destInfo();
|
||||||
|
}
|
||||||
|
if (canvas_mcdu.myFpln[1] != nil) {
|
||||||
|
canvas_mcdu.myFpln[1].destInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
me.arrivalDist = me._arrivalDist;
|
||||||
|
me.updateMCDUDriver(n);
|
||||||
|
},
|
||||||
|
|
||||||
|
updateCurrentWaypoint: func() {
|
||||||
|
for (var india = 0; india <= 2; india += 1) {
|
||||||
|
if (toFromSet.getBoolValue() and me.flightplans[india].departure != nil and me.flightplans[india].destination != nil) { # check if flightplan exists
|
||||||
|
var curAircraftPos = geo.aircraft_position(); # don't want to get this corrupted so make sure it is a local variable
|
||||||
|
|
||||||
|
if (india == 2) { # main plan
|
||||||
|
if (!me.active.getBoolValue()) {
|
||||||
|
me.active.setValue(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.currentToWptIndex.getValue() > me.flightplans[india].getPlanSize()) {
|
||||||
|
me.currentToWptIndex.setValue(me.flightplans[india].getPlanSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
me.currentToWpt = me.flightplans[india].getWP(me.currentToWptIndex.getValue());
|
||||||
|
|
||||||
|
if (me.currentToWptID.getValue() != me.currentToWpt.wp_name) {
|
||||||
|
me.currentToWptID.setValue(me.currentToWpt.wp_name);
|
||||||
|
}
|
||||||
|
me.courseToWpt.setValue(me.currentToWpt.courseAndDistanceFrom(curAircraftPos)[0]);
|
||||||
|
me.distToWpt.setValue(me.currentToWpt.courseAndDistanceFrom(curAircraftPos)[1]);
|
||||||
|
|
||||||
|
magTrueError = magHDG.getValue() - trueHDG.getValue();
|
||||||
|
me.courseMagToWpt.setValue(me.courseToWpt.getValue() + magTrueError);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.num[india].getValue() != me.flightplans[india].getPlanSize()) {
|
||||||
|
me.num[india].setValue(me.flightplans[india].getPlanSize());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (india == 2) {
|
||||||
|
if (me.active.getBoolValue()) {
|
||||||
|
me.active.setValue(0);
|
||||||
|
}
|
||||||
|
if (me.currentToWptID.getValue() != "") {
|
||||||
|
me.currentToWptID.setValue("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.num[india].getValue() != 0) {
|
||||||
|
me.num[india].setValue(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
updateMCDUDriver: func() {
|
||||||
|
for (var i = 0; i <= 1; i += 1) {
|
||||||
|
if (canvas_mcdu.myFpln[i] != nil) {
|
||||||
|
canvas_mcdu.myFpln[i].updatePlan();
|
||||||
|
}
|
||||||
|
if (canvas_mcdu.myDirTo[i] != nil) {
|
||||||
|
canvas_mcdu.myDirTo[i].updateFromFpln();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var flightPlanTimer = maketimer(0.1, flightPlanController, flightPlanController.updatePlans);
|
526
Nasal/MCDU/ARRIVAL.nas
Normal file
526
Nasal/MCDU/ARRIVAL.nas
Normal file
|
@ -0,0 +1,526 @@
|
||||||
|
var arrivalPage = {
|
||||||
|
title: [nil, nil, nil],
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
C1: [nil, nil, "ack"],
|
||||||
|
C2: [nil, nil, "ack"],
|
||||||
|
C3: [nil, nil, "ack"],
|
||||||
|
C4: [nil, nil, "ack"],
|
||||||
|
C5: [nil, nil, "ack"],
|
||||||
|
C6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
arrAirport: nil,
|
||||||
|
runways: nil,
|
||||||
|
selectedApproach: nil,
|
||||||
|
selectedVIA: nil,
|
||||||
|
selectedSTAR: nil,
|
||||||
|
selectedTransition: nil,
|
||||||
|
stars: nil,
|
||||||
|
transitions: nil,
|
||||||
|
vias: nil,
|
||||||
|
computer: nil,
|
||||||
|
enableScrollApproach: 0,
|
||||||
|
enableScrollStars: 0,
|
||||||
|
scrollApproach: 0,
|
||||||
|
scrollStars: 0,
|
||||||
|
activePage: 0, # runways, stars, trans
|
||||||
|
hasPressNoTrans: 0, # temporary
|
||||||
|
_approaches: nil,
|
||||||
|
_stars: nil,
|
||||||
|
_transitions: nil,
|
||||||
|
new: func(icao, computer) {
|
||||||
|
var lr = {parents:[arrivalPage]};
|
||||||
|
lr.id = icao;
|
||||||
|
lr.computer = computer;
|
||||||
|
lr._setupPageWithData();
|
||||||
|
return lr;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
me.title = ["ARRIVAL", " TO ", left(me.id, 4)];
|
||||||
|
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
|
||||||
|
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
|
||||||
|
}
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].star != nil) {
|
||||||
|
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
|
||||||
|
me.selectedApproach = fmgc.flightPlanController.flightplans[me.computer].approach;
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[2].approach != nil) {
|
||||||
|
me.selectedApproach = fmgc.flightPlanController.flightplans[2].approach;
|
||||||
|
}
|
||||||
|
if (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
|
||||||
|
me.selectedSTAR = fmgc.flightPlanController.flightplans[me.computer].star;
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[2].star != nil) {
|
||||||
|
me.selectedSTAR = fmgc.flightPlanController.flightplans[2].star;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.L6 = [" RETURN END", nil, "wht"];
|
||||||
|
} else {
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
me.updateApproaches();
|
||||||
|
} else {
|
||||||
|
me.updateSTARs();
|
||||||
|
}
|
||||||
|
|
||||||
|
me.updateActiveApproach();
|
||||||
|
me.updateActiveSTARs();
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
},
|
||||||
|
_clearPage: func() {
|
||||||
|
me.L1 = [nil, nil, "ack"];
|
||||||
|
me.L2 = [nil, nil, "ack"];
|
||||||
|
me.L3 = [nil, nil, "ack"];
|
||||||
|
me.L4 = [nil, nil, "ack"];
|
||||||
|
me.L5 = [nil, nil, "ack"];
|
||||||
|
me.L6 = [nil, nil, "ack"];
|
||||||
|
me.C1 = [nil, nil, "ack"];
|
||||||
|
me.C2 = [nil, nil, "ack"];
|
||||||
|
me.C3 = [nil, nil, "ack"];
|
||||||
|
me.C4 = [nil, nil, "ack"];
|
||||||
|
me.C5 = [nil, nil, "ack"];
|
||||||
|
me.C6 = [nil, nil, "ack"];
|
||||||
|
me.R1 = [nil, nil, "ack"];
|
||||||
|
me.R2 = [nil, nil, "ack"];
|
||||||
|
me.R3 = [nil, nil, "ack"];
|
||||||
|
me.R4 = [nil, nil, "ack"];
|
||||||
|
me.R5 = [nil, nil, "ack"];
|
||||||
|
me.R6 = [nil, nil, "ack"];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "ack"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
},
|
||||||
|
updatePage: func() {
|
||||||
|
me._clearPage();
|
||||||
|
me._setupPageWithData();
|
||||||
|
},
|
||||||
|
updateActiveApproach: func() {
|
||||||
|
if (me.selectedApproach != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].approach != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].approach == me.selectedApproach) {
|
||||||
|
me.L1 = [fmgc.flightPlanController.flightplans[2].approach.id, " APPR", "grn"];
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
|
||||||
|
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].approach.id, " APPR", "yel"];
|
||||||
|
} else {
|
||||||
|
me.L1 = ["---", " APPR", "wht"];
|
||||||
|
}
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].approach != nil) {
|
||||||
|
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].approach.id, " APPR", "yel"];
|
||||||
|
} else {
|
||||||
|
me.L1 = ["---", " APPR", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.L1 = ["---", " APPR", "wht"];
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateActiveSTARs: func() {
|
||||||
|
if (me.selectedSTAR != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].star != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].star == me.selectedSTAR) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[2].star.id, "SID", "grn"];
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].star != nil) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "SID", "yel"];
|
||||||
|
} else {
|
||||||
|
me.C1 = ["------- ", "STAR", "wht"];
|
||||||
|
}
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].star.id != nil) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star.id, "SID", "yel"];
|
||||||
|
} else {
|
||||||
|
me.C1 = ["------- ", "STAR", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.C1 = ["------- ", "STAR", "wht"];
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateActiveTransitions: func() {
|
||||||
|
if (!me.hasPressNoTrans) {
|
||||||
|
if (me.selectedTransition != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].star_trans != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].star_trans == me.selectedTransition) {
|
||||||
|
me.R1 = [fmgc.flightPlanController.flightplans[2].star_trans.id, "TRANS", "grn"];
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
|
||||||
|
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "TRANS", "yel"];
|
||||||
|
} else {
|
||||||
|
me.R1 = ["-------", "TRANS ", "wht"];
|
||||||
|
}
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].star_trans != nil) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].star_trans.id, "SID", "yel"];
|
||||||
|
} else {
|
||||||
|
me.R1 = ["-------", "TRANS ", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.R1 = ["-------", "TRANS ", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.R1 = ["NONE", "TRANS ", "yel"];
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateApproaches: func() {
|
||||||
|
if (me.arrAirport == nil) {
|
||||||
|
me.arrAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
}
|
||||||
|
me._approaches = me.arrAirport[0].getApproachList();
|
||||||
|
me.approaches = sort(me._approaches,func(a,b) cmp(a,b));
|
||||||
|
|
||||||
|
if (size(me.approaches) >= 1) {
|
||||||
|
me.L3 = [" " ~ me.approaches[0 + me.scrollApproach], " APPR", "blu"];
|
||||||
|
me.C3 = [math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[0 + me.scrollApproach]).runways[0]].length) ~ "M", "AVAILABLE ", "blu"];
|
||||||
|
me.R3 = ["CRS" ~ math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[0 + me.scrollApproach]).runways[0]].heading), nil, "blu"];
|
||||||
|
if (me.approaches[0 + me.scrollApproach] != me.selectedApproach) {
|
||||||
|
me.arrowsMatrix[0][2] = 1;
|
||||||
|
me.arrowsColour[0][2] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][2] = 0;
|
||||||
|
me.arrowsColour[0][2] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.approaches) >= 2) {
|
||||||
|
me.L4 = [" " ~ me.approaches[1 + me.scrollApproach], nil, "blu"];
|
||||||
|
if (me.arrAirport[0].getIAP(me.approaches[0 + me.scrollApproach]).radio == "ILS") {
|
||||||
|
me.C4 = [math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[1 + me.scrollApproach]).runways[0]].length) ~ "M", me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[0 + me.scrollApproach]).runways[0]].ils.id ~ "/" ~ sprintf("%7.2f", me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[0 + me.scrollApproach]).runways[0]].ils_frequency_mhz), "blu"];
|
||||||
|
} else {
|
||||||
|
me.C4 = [math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[1 + me.scrollApproach]).runways[0]].length) ~ "M", nil, "blu"];
|
||||||
|
}
|
||||||
|
me.R4 = ["CRS" ~ math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[1 + me.scrollApproach]).runways[0]].heading), nil, "blu"];
|
||||||
|
if (me.approaches[1 + me.scrollApproach] != me.selectedApproach) {
|
||||||
|
me.arrowsMatrix[0][3] = 1;
|
||||||
|
me.arrowsColour[0][3] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][3] = 0;
|
||||||
|
me.arrowsColour[0][3] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.approaches) >= 3) {
|
||||||
|
me.L5 = [" " ~ me.approaches[2 + me.scrollApproach], nil, "blu"];
|
||||||
|
if (me.arrAirport[0].getIAP(me.approaches[1 + me.scrollApproach]).radio == "ILS") {
|
||||||
|
me.C5 = [math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[2 + me.scrollApproach]).runways[0]].length) ~ "M", me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[1 + me.scrollApproach]).runways[0]].ils.id ~ "/" ~ sprintf("%7.2f", me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[1 + me.scrollApproach]).runways[0]].ils_frequency_mhz), "blu"];
|
||||||
|
} else {
|
||||||
|
me.C5 = [math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[2 + me.scrollApproach]).runways[0]].length) ~ "M", nil, "blu"];
|
||||||
|
}
|
||||||
|
me.R5 = ["CRS" ~ math.round(me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[2 + me.scrollApproach]).runways[0]].heading), nil, "blu"];
|
||||||
|
if (me.arrAirport[0].getIAP(me.approaches[2 + me.scrollApproach]).radio == "ILS") {
|
||||||
|
me.C6[1] = me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[2 + me.scrollApproach]).runways[0]].ils.id ~ "/" ~ sprintf("%7.2f", me.arrAirport[0].runways[me.arrAirport[0].getIAP(me.approaches[2 + me.scrollApproach]).runways[0]].ils_frequency_mhz);
|
||||||
|
}
|
||||||
|
if (me.approaches[2 + me.scrollApproach] != me.selectedApproach) {
|
||||||
|
me.arrowsMatrix[0][4] = 1;
|
||||||
|
me.arrowsColour[0][4] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][3] = 0;
|
||||||
|
me.arrowsColour[0][3] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(me.approaches) > 3) {
|
||||||
|
me.enableScrollApproach = 1;
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateSTARs: func() {
|
||||||
|
if (me.arrAirport == nil) {
|
||||||
|
me.arrAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
}
|
||||||
|
if (me.selectedApproach != nil) {
|
||||||
|
me._stars = me.arrAirport[0].stars(me.selectedApproach.runways[0]);
|
||||||
|
} else {
|
||||||
|
me._stars = me.arrAirport[0].stars();
|
||||||
|
}
|
||||||
|
|
||||||
|
me.stars = sort(me._stars,func(a,b) cmp(a,b));
|
||||||
|
|
||||||
|
if (size(me.stars) >= 1) {
|
||||||
|
me.L2 = [" " ~ me.stars[0 + me.scrollStars], "STARS", "blu"];
|
||||||
|
if (me.stars[0 + me.scrollStars] != me.selectedSTAR) {
|
||||||
|
me.arrowsMatrix[0][1] = 1;
|
||||||
|
me.arrowsColour[0][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][1] = 0;
|
||||||
|
me.arrowsColour[0][1] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.stars) >= 2) {
|
||||||
|
me.L3 = [" " ~ me.stars[1 + me.scrollStars], nil, "blu"];
|
||||||
|
if (me.stars[1 + me.scrollStars] != me.selectedSTAR) {
|
||||||
|
me.arrowsMatrix[0][2] = 1;
|
||||||
|
me.arrowsColour[0][2] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][2] = 0;
|
||||||
|
me.arrowsColour[0][2] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.stars) >= 3) {
|
||||||
|
me.L4 = [" " ~ me.stars[2 + me.scrollStars], nil, "blu"];
|
||||||
|
if (me.stars[2 + me.scrollStars] != me.selectedSTAR) {
|
||||||
|
me.arrowsMatrix[0][3] = 1;
|
||||||
|
me.arrowsColour[0][3] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][3] = 0;
|
||||||
|
me.arrowsColour[0][3] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.stars) >= 4) {
|
||||||
|
me.L5 = [" " ~ me.stars[3 + me.scrollStars], nil, "blu"];
|
||||||
|
if (me.stars[3 + me.scrollStars] != me.selectedSTAR) {
|
||||||
|
me.arrowsMatrix[0][4] = 1;
|
||||||
|
me.arrowsColour[0][4] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][4] = 0;
|
||||||
|
me.arrowsColour[0][4] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
me.C2 = [nil, "AVAILABLE", "wht"];
|
||||||
|
me.R2 = [nil, "TRANS ", "wht"];
|
||||||
|
|
||||||
|
if (size(me.stars) > 4) {
|
||||||
|
me.enableScrollStars = 1;
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
clearTransitions: func() {
|
||||||
|
me.R2 = [nil, "TRANS", "wht"];
|
||||||
|
me.R3 = [nil, "TRANS", "wht"];
|
||||||
|
me.R4 = [nil, "TRANS", "wht"];
|
||||||
|
me.R5 = [nil, "TRANS", "wht"];
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
me.arrowsMatrix[1][2] = 0;
|
||||||
|
me.arrowsColour[1][2] = "ack";
|
||||||
|
me.arrowsMatrix[1][3] = 0;
|
||||||
|
me.arrowsColour[1][3] = "ack";
|
||||||
|
me.arrowsMatrix[1][4] = 0;
|
||||||
|
me.arrowsColour[1][4] = "ack";
|
||||||
|
},
|
||||||
|
updateTransitions: func() {
|
||||||
|
if (me.arrAirport == nil) {
|
||||||
|
me.arrAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
}
|
||||||
|
if (me.selectedSTAR == nil) {
|
||||||
|
me.R2 = ["NO TRANS ", "TRANS", "blu"];
|
||||||
|
if (!me.hasPressNoTrans) {
|
||||||
|
me.arrowsMatrix[1][1] = 1;
|
||||||
|
me.arrowsColour[1][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
me._transitions = me.arrAirport[0].getStar(me.selectedSTAR).transitions;
|
||||||
|
me.transitions = sort(me._transitions,func(a,b) cmp(a,b));
|
||||||
|
|
||||||
|
if (size(me.transitions) == 0) {
|
||||||
|
me.R2 = ["NO TRANS ", "TRANS", "blu"];
|
||||||
|
if (!me.hasPressNoTrans) {
|
||||||
|
me.arrowsMatrix[1][1] = 1;
|
||||||
|
me.arrowsColour[1][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 1) {
|
||||||
|
me.R2 = [me.transitions[0] ~ " ", "TRANS", "blu"];
|
||||||
|
if (me.transitions[0] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][1] = 1;
|
||||||
|
me.arrowsColour[1][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 2) {
|
||||||
|
me.R3 = [me.transitions[1] ~ " ", nil, "blu"];
|
||||||
|
if (me.transitions[1] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][2] = 1;
|
||||||
|
me.arrowsColour[1][2] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][2] = 0;
|
||||||
|
me.arrowsColour[1][2] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 3) {
|
||||||
|
me.R4 = [me.transitions[2] ~ " ", nil, "blu"];
|
||||||
|
if (me.transitions[2] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][3] = 1;
|
||||||
|
me.arrowsColour[1][3] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][3] = 0;
|
||||||
|
me.arrowsColour[1][3] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 4) {
|
||||||
|
me.R5 = [me.transitions[3] ~ " ", nil, "blu"];
|
||||||
|
if (me.transitions[3] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][4] = 1;
|
||||||
|
me.arrowsColour[1][4] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][4] = 0;
|
||||||
|
me.arrowsColour[1][4] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeTmpy: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollUp: func() {
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
if (me.enableScrollApproach) {
|
||||||
|
me.scrollApproach += 1;
|
||||||
|
if (me.scrollApproach > size(me.approaches) - 4) {
|
||||||
|
me.scrollApproach = 0;
|
||||||
|
}
|
||||||
|
me.updateApproaches();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.enableScrollStars) {
|
||||||
|
me.scrollStars += 1;
|
||||||
|
if (me.scrollStars > size(me.stars) - 4) {
|
||||||
|
me.scrollStars = 0;
|
||||||
|
}
|
||||||
|
me.updateSTARs();
|
||||||
|
if (me.selectedSTAR == nil) {
|
||||||
|
me.clearTransitions();
|
||||||
|
} else {
|
||||||
|
me.updateTransitions();
|
||||||
|
}
|
||||||
|
me.hasPressNoTrans = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollDn: func() {
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
if (me.enableScrollApproach) {
|
||||||
|
me.scrollApproach -= 1;
|
||||||
|
if (me.scrollApproach < 0) {
|
||||||
|
me.scrollApproach = size(me.approaches) - 4;
|
||||||
|
}
|
||||||
|
me.updateApproaches();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.enableScrollStars) {
|
||||||
|
me.scrollStars -= 1;
|
||||||
|
if (me.scrollStars < 0) {
|
||||||
|
me.scrollStars = size(me.stars) - 4;
|
||||||
|
}
|
||||||
|
me.updateSTARs();
|
||||||
|
if (me.selectedSTAR == nil) {
|
||||||
|
me.clearTransitions();
|
||||||
|
} else {
|
||||||
|
me.updateTransitions();
|
||||||
|
}
|
||||||
|
me.hasPressNoTrans = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollLeft: func() {
|
||||||
|
me.activePage = !me.activePage;
|
||||||
|
me.updatePage();
|
||||||
|
},
|
||||||
|
scrollRight: func() {
|
||||||
|
me.activePage = !me.activePage;
|
||||||
|
me.updatePage();
|
||||||
|
},
|
||||||
|
arrPushbuttonLeft: func(index) {
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
if (size(me.approaches) >= (index - 1) and index != 2) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.selectedApproach = me.arrAirport[0].getIAP(me.approaches[index - 3 + me.scrollApproach]);
|
||||||
|
me.makeTmpy();
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].destination_runway = me.arrAirport[0].runways[me.selectedApproach.runways[0]];
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].approach = me.selectedApproach;
|
||||||
|
me.updateActiveApproach();
|
||||||
|
me.updateApproaches();
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
me.scrollRight();
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (size(me.stars) >= (index - 1)) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.selectedSTAR = me.stars[index - 2 + me.scrollStars];
|
||||||
|
me.makeTmpy();
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].star = me.arrAirport[0].getStar(me.selectedSTAR);
|
||||||
|
me.updateActiveSTARs();
|
||||||
|
me.updateSTARs();
|
||||||
|
me.hasPressNoTrans = 0;
|
||||||
|
me.updateTransitions();
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
arrPushbuttonRight: func(index) {
|
||||||
|
if (index == 2 and size(me.transitions) == 0) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.hasPressNoTrans = 1;
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
me.updateTransitions();
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= (index - 1)) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.selectedTransition = me.transitions[index - 2];
|
||||||
|
me.makeTmpy();
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].star_trans = me.selectedTransition;
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
me.updateTransitions();
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
528
Nasal/MCDU/DEPARTURE.nas
Normal file
528
Nasal/MCDU/DEPARTURE.nas
Normal file
|
@ -0,0 +1,528 @@
|
||||||
|
var departurePage = {
|
||||||
|
title: [nil, nil, nil],
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
C1: [nil, nil, "ack"],
|
||||||
|
C2: [nil, nil, "ack"],
|
||||||
|
C3: [nil, nil, "ack"],
|
||||||
|
C4: [nil, nil, "ack"],
|
||||||
|
C5: [nil, nil, "ack"],
|
||||||
|
C6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
depAirport: nil,
|
||||||
|
runways: nil,
|
||||||
|
selectedRunway: nil,
|
||||||
|
selectedSID: nil,
|
||||||
|
selectedTransition: nil,
|
||||||
|
sids: nil,
|
||||||
|
transitions: nil,
|
||||||
|
computer: nil,
|
||||||
|
enableScrollRwy: 0,
|
||||||
|
enableScrollSids: 0,
|
||||||
|
scrollRwy: 0,
|
||||||
|
scrollSids: 0,
|
||||||
|
activePage: 0, # runways, sids, trans
|
||||||
|
hasPressNoTrans: 0, # temporary
|
||||||
|
_runways: nil,
|
||||||
|
_sids: nil,
|
||||||
|
_transitions: nil,
|
||||||
|
new: func(icao, computer) {
|
||||||
|
var lr = {parents:[departurePage]};
|
||||||
|
lr.id = icao;
|
||||||
|
lr.computer = computer;
|
||||||
|
lr._setupPageWithData();
|
||||||
|
return lr;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
me.title = ["DEPARTURE", " FROM ", left(me.id, 4)];
|
||||||
|
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
|
||||||
|
me.selectedRunway = fmgc.flightPlanController.flightplans[2].departure_runway;
|
||||||
|
}
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].sid != nil) {
|
||||||
|
me.selectedSID = fmgc.flightPlanController.flightplans[2].sid;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (fmgc.flightPlanController.flightplans[me.computer].departure_runway != nil) {
|
||||||
|
me.selectedRunway = fmgc.flightPlanController.flightplans[me.computer].departure_runway;
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
|
||||||
|
me.selectedRunway = fmgc.flightPlanController.flightplans[2].departure_runway;
|
||||||
|
}
|
||||||
|
if (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
|
||||||
|
me.selectedSID = fmgc.flightPlanController.flightplans[me.computer].sid;
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[2].sid != nil) {
|
||||||
|
me.selectedSID = fmgc.flightPlanController.flightplans[2].sid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.L6 = [" RETURN END", nil, "wht"];
|
||||||
|
} else {
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
me.updateRunways();
|
||||||
|
} else {
|
||||||
|
me.updateSIDs();
|
||||||
|
}
|
||||||
|
|
||||||
|
me.updateActiveRunway();
|
||||||
|
me.updateActiveSIDs();
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
},
|
||||||
|
_clearPage: func() {
|
||||||
|
me.L1 = [nil, nil, "ack"];
|
||||||
|
me.L2 = [nil, nil, "ack"];
|
||||||
|
me.L3 = [nil, nil, "ack"];
|
||||||
|
me.L4 = [nil, nil, "ack"];
|
||||||
|
me.L5 = [nil, nil, "ack"];
|
||||||
|
me.L6 = [nil, nil, "ack"];
|
||||||
|
me.C1 = [nil, nil, "ack"];
|
||||||
|
me.C2 = [nil, nil, "ack"];
|
||||||
|
me.C3 = [nil, nil, "ack"];
|
||||||
|
me.C4 = [nil, nil, "ack"];
|
||||||
|
me.C5 = [nil, nil, "ack"];
|
||||||
|
me.C6 = [nil, nil, "ack"];
|
||||||
|
me.R1 = [nil, nil, "ack"];
|
||||||
|
me.R2 = [nil, nil, "ack"];
|
||||||
|
me.R3 = [nil, nil, "ack"];
|
||||||
|
me.R4 = [nil, nil, "ack"];
|
||||||
|
me.R5 = [nil, nil, "ack"];
|
||||||
|
me.R6 = [nil, nil, "ack"];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "ack"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
},
|
||||||
|
updatePage: func() {
|
||||||
|
me._clearPage();
|
||||||
|
me._setupPageWithData();
|
||||||
|
},
|
||||||
|
updateActiveRunway: func() {
|
||||||
|
if (me.selectedRunway != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].departure_runway.id == me.selectedRunway.id) {
|
||||||
|
me.L1 = [fmgc.flightPlanController.flightplans[2].departure_runway.id, " RWY", "grn"];
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].departure_runway != nil) {
|
||||||
|
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].departure_runway.id, " RWY", "yel"];
|
||||||
|
} else {
|
||||||
|
me.L1 = ["---", " RWY", "wht"];
|
||||||
|
}
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].departure_runway != nil) {
|
||||||
|
me.L1 = [fmgc.flightPlanController.flightplans[me.computer].departure_runway.id, " RWY", "yel"];
|
||||||
|
} else {
|
||||||
|
me.L1 = ["---", " RWY", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.L1 = ["---", " RWY", "wht"];
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateActiveSIDs: func() {
|
||||||
|
if (me.selectedSID != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].sid != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].sid == me.selectedSID) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[2].sid.id, "SID", "grn"];
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid != nil) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].sid.id, "SID", "yel"];
|
||||||
|
} else {
|
||||||
|
me.C1 = ["------- ", "SID", "wht"];
|
||||||
|
}
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid.id != nil) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].sid.id, "SID", "yel"];
|
||||||
|
} else {
|
||||||
|
me.C1 = ["------- ", "SID", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.C1 = ["------- ", "SID", "wht"];
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateActiveTransitions: func() {
|
||||||
|
if (!me.hasPressNoTrans) {
|
||||||
|
if (me.selectedTransition != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].sid_trans != nil) {
|
||||||
|
if (fmgc.flightPlanController.flightplans[2].sid_trans == me.selectedTransition) {
|
||||||
|
me.R1 = [fmgc.flightPlanController.flightplans[2].sid_trans.id, "TRANS", "grn"];
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) {
|
||||||
|
me.R1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "TRANS", "yel"];
|
||||||
|
} else {
|
||||||
|
me.R1 = ["-------", "TRANS ", "wht"];
|
||||||
|
}
|
||||||
|
} elsif (fmgc.flightPlanController.flightplans[me.computer].sid_trans != nil) {
|
||||||
|
me.C1 = [fmgc.flightPlanController.flightplans[me.computer].sid_trans.id, "SID", "yel"];
|
||||||
|
} else {
|
||||||
|
me.R1 = ["-------", "TRANS ", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.R1 = ["-------", "TRANS ", "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.R1 = ["NONE", "TRANS ", "yel"];
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateRunways: func() {
|
||||||
|
if (me.depAirport == nil) {
|
||||||
|
me.depAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
}
|
||||||
|
me._runways = keys(me.depAirport[0].runways);
|
||||||
|
me.runways = sort(me._runways,func(a,b) cmp(a,b));
|
||||||
|
|
||||||
|
if (size(me.runways) >= 1) {
|
||||||
|
me.L2 = [" " ~ me.runways[0 + me.scrollRwy], nil, "blu"];
|
||||||
|
me.C2 = [math.round(me.depAirport[0].runways[me.runways[0 + me.scrollRwy]].length) ~ "M", "AVAILABLE RUNWAYS", "blu"];
|
||||||
|
me.R2 = ["CRS" ~ math.round(me.depAirport[0].runways[me.runways[0 + me.scrollRwy]].heading), nil, "blu"];
|
||||||
|
if (me.runways[0 + me.scrollRwy] != me.selectedRunway) {
|
||||||
|
me.arrowsMatrix[0][1] = 1;
|
||||||
|
me.arrowsColour[0][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][1] = 0;
|
||||||
|
me.arrowsColour[0][1] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.runways) >= 2) {
|
||||||
|
me.L3 = [" " ~ me.runways[1 + me.scrollRwy], nil, "blu"];
|
||||||
|
me.C3 = [math.round(me.depAirport[0].runways[me.runways[1 + me.scrollRwy]].length) ~ "M", nil, "blu"];
|
||||||
|
me.R3 = ["CRS" ~ math.round(me.depAirport[0].runways[me.runways[1 + me.scrollRwy]].heading), nil, "blu"];
|
||||||
|
if (me.runways[1 + me.scrollRwy] != me.selectedRunway) {
|
||||||
|
me.arrowsMatrix[0][2] = 1;
|
||||||
|
me.arrowsColour[0][2] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][2] = 0;
|
||||||
|
me.arrowsColour[0][2] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.runways) >= 3) {
|
||||||
|
me.L4 = [" " ~ me.runways[2 + me.scrollRwy], nil, "blu"];
|
||||||
|
me.C4 = [math.round(me.depAirport[0].runways[me.runways[2 + me.scrollRwy]].length) ~ "M", nil, "blu"];
|
||||||
|
me.R4 = ["CRS" ~ math.round(me.depAirport[0].runways[me.runways[2 + me.scrollRwy]].heading), nil, "blu"];
|
||||||
|
if (me.runways[2 + me.scrollRwy] != me.selectedRunway) {
|
||||||
|
me.arrowsMatrix[0][3] = 1;
|
||||||
|
me.arrowsColour[0][3] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][3] = 0;
|
||||||
|
me.arrowsColour[0][3] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.runways) >= 4) {
|
||||||
|
me.L5 = [" " ~ me.runways[3 + me.scrollRwy], nil, "blu"];
|
||||||
|
me.C5 = [math.round(me.depAirport[0].runways[me.runways[3 + me.scrollRwy]].length) ~ "M", nil, "blu"];
|
||||||
|
me.R5 = ["CRS" ~ math.round(me.depAirport[0].runways[me.runways[3 + me.scrollRwy]].heading), nil, "blu"];
|
||||||
|
if (me.runways[3 + me.scrollRwy] != me.selectedRunway) {
|
||||||
|
me.arrowsMatrix[0][4] = 1;
|
||||||
|
me.arrowsColour[0][4] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][4] = 0;
|
||||||
|
me.arrowsColour[0][4] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(me.runways) > 4) {
|
||||||
|
me.enableScrollRwy = 1;
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateSIDs: func() {
|
||||||
|
if (me.depAirport == nil) {
|
||||||
|
me.depAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
}
|
||||||
|
if (me.selectedRunway != nil) {
|
||||||
|
me._sids = me.depAirport[0].sids(me.selectedRunway.id);
|
||||||
|
if (size(me._sids) == 0) { # account for cases such as EGJJ where runway code does not match SIDS
|
||||||
|
me._sids = me.depAirport[0].sids();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me._sids = me.depAirport[0].sids();
|
||||||
|
}
|
||||||
|
|
||||||
|
me.sids = sort(me._sids,func(a,b) cmp(a,b));
|
||||||
|
|
||||||
|
if (size(me.sids) >= 1) {
|
||||||
|
me.L2 = [" " ~ me.sids[0 + me.scrollSids], "SIDS", "blu"];
|
||||||
|
if (me.sids[0 + me.scrollSids] != me.selectedSID) {
|
||||||
|
me.arrowsMatrix[0][1] = 1;
|
||||||
|
me.arrowsColour[0][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][1] = 0;
|
||||||
|
me.arrowsColour[0][1] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.sids) >= 2) {
|
||||||
|
me.L3 = [" " ~ me.sids[1 + me.scrollSids], nil, "blu"];
|
||||||
|
if (me.sids[1 + me.scrollSids] != me.selectedSID) {
|
||||||
|
me.arrowsMatrix[0][2] = 1;
|
||||||
|
me.arrowsColour[0][2] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][2] = 0;
|
||||||
|
me.arrowsColour[0][2] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.sids) >= 3) {
|
||||||
|
me.L4 = [" " ~ me.sids[2 + me.scrollSids], nil, "blu"];
|
||||||
|
if (me.sids[2 + me.scrollSids] != me.selectedSID) {
|
||||||
|
me.arrowsMatrix[0][3] = 1;
|
||||||
|
me.arrowsColour[0][3] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][3] = 0;
|
||||||
|
me.arrowsColour[0][3] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.sids) >= 4) {
|
||||||
|
me.L5 = [" " ~ me.sids[3 + me.scrollSids], nil, "blu"];
|
||||||
|
if (me.sids[3 + me.scrollSids] != me.selectedSID) {
|
||||||
|
me.arrowsMatrix[0][4] = 1;
|
||||||
|
me.arrowsColour[0][4] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[0][4] = 0;
|
||||||
|
me.arrowsColour[0][4] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
me.C2 = [nil, "AVAILABLE", "wht"];
|
||||||
|
me.R2 = [nil, "TRANS ", "wht"];
|
||||||
|
|
||||||
|
if (size(me.sids) > 4) {
|
||||||
|
me.enableScrollSids = 1;
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
clearTransitions: func() {
|
||||||
|
me.R2 = [nil, "TRANS", "wht"];
|
||||||
|
me.R3 = [nil, "TRANS", "wht"];
|
||||||
|
me.R4 = [nil, "TRANS", "wht"];
|
||||||
|
me.R5 = [nil, "TRANS", "wht"];
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
me.arrowsMatrix[1][2] = 0;
|
||||||
|
me.arrowsColour[1][2] = "ack";
|
||||||
|
me.arrowsMatrix[1][3] = 0;
|
||||||
|
me.arrowsColour[1][3] = "ack";
|
||||||
|
me.arrowsMatrix[1][4] = 0;
|
||||||
|
me.arrowsColour[1][4] = "ack";
|
||||||
|
},
|
||||||
|
updateTransitions: func() {
|
||||||
|
if (me.depAirport == nil) {
|
||||||
|
me.depAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me.selectedSID == nil) {
|
||||||
|
me.R2 = ["NO TRANS ", "TRANS", "blu"];
|
||||||
|
if (!me.hasPressNoTrans) {
|
||||||
|
me.arrowsMatrix[1][1] = 1;
|
||||||
|
me.arrowsColour[1][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
me._transitions = me.depAirport[0].getSid(me.selectedSID).transitions;
|
||||||
|
me.transitions = sort(me._transitions,func(a,b) cmp(a,b));
|
||||||
|
|
||||||
|
if (size(me.transitions) == 0) {
|
||||||
|
me.R2 = ["NO TRANS ", "TRANS", "blu"];
|
||||||
|
if (!me.hasPressNoTrans) {
|
||||||
|
me.arrowsMatrix[1][1] = 1;
|
||||||
|
me.arrowsColour[1][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 1) {
|
||||||
|
me.R2 = [me.transitions[0] ~ " ", "TRANS", "blu"];
|
||||||
|
if (me.transitions[0] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][1] = 1;
|
||||||
|
me.arrowsColour[1][1] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][1] = 0;
|
||||||
|
me.arrowsColour[1][1] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 2) {
|
||||||
|
me.R3 = [me.transitions[1] ~ " ", nil, "blu"];
|
||||||
|
if (me.transitions[1] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][2] = 1;
|
||||||
|
me.arrowsColour[1][2] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][2] = 0;
|
||||||
|
me.arrowsColour[1][2] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 3) {
|
||||||
|
me.R4 = [me.transitions[2] ~ " ", nil, "blu"];
|
||||||
|
if (me.transitions[2] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][3] = 1;
|
||||||
|
me.arrowsColour[1][3] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][3] = 0;
|
||||||
|
me.arrowsColour[1][3] = "ack";
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= 4) {
|
||||||
|
me.R5 = [me.transitions[3] ~ " ", nil, "blu"];
|
||||||
|
if (me.transitions[3] != me.selectedTransition) {
|
||||||
|
me.arrowsMatrix[1][4] = 1;
|
||||||
|
me.arrowsColour[1][4] = "blu";
|
||||||
|
} else {
|
||||||
|
me.arrowsMatrix[1][4] = 0;
|
||||||
|
me.arrowsColour[1][4] = "ack";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeTmpy: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollUp: func() {
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
if (me.enableScrollRwy) {
|
||||||
|
me.scrollRwy += 1;
|
||||||
|
if (me.scrollRwy > size(me.runways) - 4) {
|
||||||
|
me.scrollRwy = 0;
|
||||||
|
}
|
||||||
|
me.updateRunways();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.enableScrollSids) {
|
||||||
|
me.scrollSids += 1;
|
||||||
|
if (me.scrollSids > size(me.sids) - 4) {
|
||||||
|
me.scrollSids = 0;
|
||||||
|
}
|
||||||
|
me.updateSIDs();
|
||||||
|
if (me.selectedSID == nil) {
|
||||||
|
me.clearTransitions();
|
||||||
|
} else {
|
||||||
|
me.updateTransitions();
|
||||||
|
}
|
||||||
|
me.hasPressNoTrans = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollDn: func() {
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
if (me.enableScrollRwy) {
|
||||||
|
me.scrollRwy -= 1;
|
||||||
|
if (me.scrollRwy < 0) {
|
||||||
|
me.scrollRwy = size(me.runways) - 4;
|
||||||
|
}
|
||||||
|
me.updateRunways();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.enableScrollSids) {
|
||||||
|
me.scrollSids -= 1;
|
||||||
|
if (me.scrollSids < 0) {
|
||||||
|
me.scrollSids = size(me.sids) - 4;
|
||||||
|
}
|
||||||
|
me.updateSIDs();
|
||||||
|
if (me.selectedSID == nil) {
|
||||||
|
me.clearTransitions();
|
||||||
|
} else {
|
||||||
|
me.updateTransitions();
|
||||||
|
}
|
||||||
|
me.hasPressNoTrans = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollLeft: func() {
|
||||||
|
me.activePage = !me.activePage;
|
||||||
|
me.updatePage();
|
||||||
|
},
|
||||||
|
scrollRight: func() {
|
||||||
|
me.activePage = !me.activePage;
|
||||||
|
me.updatePage();
|
||||||
|
},
|
||||||
|
depPushbuttonLeft: func(index) {
|
||||||
|
if (me.activePage == 0) {
|
||||||
|
if (size(me.runways) >= (index - 1)) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.selectedRunway = me.depAirport[0].runway(me.runways[index - 2 + me.scrollRwy]);
|
||||||
|
me.makeTmpy();
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].departure_runway = me.selectedRunway;
|
||||||
|
me.updateActiveRunway();
|
||||||
|
me.updateRunways();
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
me.scrollRight();
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (size(me.sids) >= (index - 1)) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.selectedSID = me.sids[index - 2 + me.scrollSids];
|
||||||
|
me.makeTmpy();
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].sid = me.selectedSID;
|
||||||
|
me.updateActiveSIDs();
|
||||||
|
me.updateSIDs();
|
||||||
|
me.hasPressNoTrans = 0;
|
||||||
|
me.updateTransitions();
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
depPushbuttonRight: func(index) {
|
||||||
|
if (index == 2 and size(me.transitions) == 0) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.hasPressNoTrans = 1;
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
me.updateTransitions();
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} elsif (size(me.transitions) >= (index - 1)) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
me.selectedTransition = me.transitions[index - 2];
|
||||||
|
me.makeTmpy();
|
||||||
|
fmgc.flightPlanController.flightplans[me.computer].sid = me.depAirport[0].getSid(me.selectedSID).transition(me.selectedTransition);
|
||||||
|
me.updateActiveTransitions();
|
||||||
|
me.updateTransitions();
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
275
Nasal/MCDU/DIRTO.nas
Normal file
275
Nasal/MCDU/DIRTO.nas
Normal file
|
@ -0,0 +1,275 @@
|
||||||
|
var dirToFlag = 0;
|
||||||
|
|
||||||
|
var dirTo = {
|
||||||
|
title: [nil],
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
scroll: 0,
|
||||||
|
vector: [],
|
||||||
|
index: nil,
|
||||||
|
computer: nil,
|
||||||
|
new: func(computer) {
|
||||||
|
var dt = {parents:[dirTo]};
|
||||||
|
dt.computer = computer;
|
||||||
|
dt._setupPageWithData();
|
||||||
|
return dt;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
me.title = ["DIR TO"];
|
||||||
|
me.titleColour = "wht";
|
||||||
|
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||||
|
me.L2 = [nil, " F-PLN WPTS", "blu"];
|
||||||
|
me.L3 = [nil, nil, "blu"];
|
||||||
|
me.L4 = [nil, nil, "blu"];
|
||||||
|
me.L5 = [nil, nil, "blu"];
|
||||||
|
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||||
|
me.R2 = ["DIRECT TO ", nil, "blu"];
|
||||||
|
me.R3 = ["ABEAM PTS ", "WITH ", "blu"];
|
||||||
|
me.R4 = ["[ ] ", "RADIAL IN ", "blu"];
|
||||||
|
me.R5 = ["[ ] ", "RADIAL OUT ", "blu"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "blu", "blu", "blu", "blu", "ack"], ["ack", "blu", "blu", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]];
|
||||||
|
me.updateFromFpln();
|
||||||
|
me.updateTmpy();
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
makeTmpy: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||||
|
}
|
||||||
|
dirToFlag = 1;
|
||||||
|
},
|
||||||
|
insertDirTo: func() {
|
||||||
|
dirToFlag = 0;
|
||||||
|
},
|
||||||
|
updateTmpy: func() {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.L1[2] = "yel";
|
||||||
|
me.R2[2] = "yel";
|
||||||
|
me.arrowsMatrix[1][2] = 1;
|
||||||
|
me.titleColour = "yel";
|
||||||
|
} else {
|
||||||
|
me.L1[2] = "blu";
|
||||||
|
me.R2[2] = "blu";
|
||||||
|
me.arrowsMatrix[1][2] = 0;
|
||||||
|
me.titleColour = "wht";
|
||||||
|
}
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
updateFromFpln: func() {
|
||||||
|
if (canvas_mcdu.myFpln[me.computer] == nil) {
|
||||||
|
canvas_mcdu.myFpln[me.computer] = fplnPage.new(2, me.computer);
|
||||||
|
}
|
||||||
|
|
||||||
|
var x = 0;
|
||||||
|
me.vector = [];
|
||||||
|
for (var i = 1 + (me.scroll); i < size(canvas_mcdu.myFpln[me.computer].planList) - 2; i = i + 1) {
|
||||||
|
if (canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_name == "DISCONTINUITY" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_name == "VECTORS" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_name == "T-P" or canvas_mcdu.myFpln[me.computer].planList[i].wp.wp_type == "hdgToAlt") { continue; } # can't ever have tmpy with dir to
|
||||||
|
if (canvas_mcdu.myFpln[me.computer].planList[i].index > fmgc.flightPlanController.arrivalIndex[2]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
append(me.vector, canvas_mcdu.myFpln[me.computer].planList[i].wp);
|
||||||
|
x += 1;
|
||||||
|
if (x == 4) { break; }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(me.vector) > 0) {
|
||||||
|
me.L2[0] = " " ~ me.vector[0].wp_name;
|
||||||
|
me.arrowsMatrix[0][1] = 1;
|
||||||
|
} else {
|
||||||
|
me.L2[0] = nil;
|
||||||
|
me.arrowsMatrix[0][1] = 0;
|
||||||
|
}
|
||||||
|
if (size(me.vector) > 1) {
|
||||||
|
me.L3[0] = " " ~ me.vector[1].wp_name;
|
||||||
|
me.arrowsMatrix[0][2] = 1;
|
||||||
|
} else {
|
||||||
|
me.L3[0] = nil;
|
||||||
|
me.arrowsMatrix[0][2] = 0;
|
||||||
|
}
|
||||||
|
if (size(me.vector) > 2) {
|
||||||
|
me.L4[0] = " " ~ me.vector[2].wp_name;
|
||||||
|
me.arrowsMatrix[0][3] = 1;
|
||||||
|
} else {
|
||||||
|
me.L4[0] = nil;
|
||||||
|
me.arrowsMatrix[0][3] = 0;
|
||||||
|
}
|
||||||
|
if (size(me.vector) > 3) {
|
||||||
|
me.L5[0] = " " ~ me.vector[3].wp_name;
|
||||||
|
me.arrowsMatrix[0][4] = 1;
|
||||||
|
} else {
|
||||||
|
me.L5[0] = nil;
|
||||||
|
me.arrowsMatrix[0][4] = 0;
|
||||||
|
}
|
||||||
|
me.updateTmpy();
|
||||||
|
},
|
||||||
|
scrollUp: func() {
|
||||||
|
if (size(canvas_mcdu.myFpln[me.computer].planList) > 4) {
|
||||||
|
me.scroll += 1;
|
||||||
|
if (me.scroll > size(canvas_mcdu.myFpln[me.computer].planList) - 6) {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
me.updateFromFpln();
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
scrollDn: func() {
|
||||||
|
if (size(canvas_mcdu.myFpln[me.computer].planList) > 4) {
|
||||||
|
me.scroll -= 1;
|
||||||
|
if (me.scroll < 0) {
|
||||||
|
me.scroll = size(canvas_mcdu.myFpln[me.computer].planList) - 6;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
me.updateFromFpln();
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
fieldL1: func(text, override = 0, overrideIndex = -1) {
|
||||||
|
me.makeTmpy();
|
||||||
|
me.L1[0] = text;
|
||||||
|
if (size(text) == 16) {
|
||||||
|
# lat lon
|
||||||
|
var lat = split("/", text)[0];
|
||||||
|
var lon = split("/", text)[1];
|
||||||
|
var latDecimal = mcdu.stringToDegrees(lat, "lat");
|
||||||
|
var lonDecimal = mcdu.stringToDegrees(lon, "lon");
|
||||||
|
|
||||||
|
if (latDecimal > 90 or latDecimal < -90 or lonDecimal > 180 or lonDecimal < -180) {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
|
||||||
|
var myWpLatLon = createWP(latDecimal, lonDecimal, "LL" ~ 01);
|
||||||
|
fmgc.flightPlanController.directTo(myWpLatLon, me.computer);
|
||||||
|
|
||||||
|
} elsif (size(text) == 5) {
|
||||||
|
# fix
|
||||||
|
var fix = findFixesByID(text);
|
||||||
|
if (size(fix) == 0) {
|
||||||
|
notInDataBase(me.computer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(fix) == 1 or override) {
|
||||||
|
if (!override) {
|
||||||
|
fmgc.flightPlanController.directTo(fix[0], me.computer);
|
||||||
|
} else {
|
||||||
|
fmgc.flightPlanController.directTo(fix[overrideIndex], me.computer);
|
||||||
|
}
|
||||||
|
} elsif (size(fix) >= 1) {
|
||||||
|
if (canvas_mcdu.myDuplicate[me.computer] != nil) {
|
||||||
|
canvas_mcdu.myDuplicate[me.computer].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDuplicate[me.computer] = nil;
|
||||||
|
canvas_mcdu.myDuplicate[me.computer] = mcdu.duplicateNamesPage.new(fix, 0, 0, me.computer);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "DUPLICATENAMES");
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif (size(text) == 4) {
|
||||||
|
# airport
|
||||||
|
var airport = findAirportsByICAO(text);
|
||||||
|
if (size(airport) == 0) {
|
||||||
|
notInDataBase(me.computer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(airport) == 1 or override) {
|
||||||
|
if (!override) {
|
||||||
|
fmgc.flightPlanController.directTo(airport[0], me.computer);
|
||||||
|
} else {
|
||||||
|
fmgc.flightPlanController.directTo(airport[overrideIndex], me.computer);
|
||||||
|
}
|
||||||
|
} elsif (size(airport) >= 1) {
|
||||||
|
if (canvas_mcdu.myDuplicate[me.computer] != nil) {
|
||||||
|
canvas_mcdu.myDuplicate[me.computer].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDuplicate[me.computer] = nil;
|
||||||
|
canvas_mcdu.myDuplicate[me.computer] = mcdu.duplicateNamesPage.new(airport, 0, 0, me.computer);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "DUPLICATENAMES");
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif (size(text) == 3 or size(text) == 2) {
|
||||||
|
# navaid
|
||||||
|
var navaid = findNavaidsByID(text);
|
||||||
|
if (size(navaid) == 0) {
|
||||||
|
notInDataBase(me.computer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size(navaid) == 1 or override) {
|
||||||
|
if (!override) {
|
||||||
|
fmgc.flightPlanController.directTo(navaid[0], me.computer);
|
||||||
|
} else {
|
||||||
|
fmgc.flightPlanController.directTo(navaid[overrideIndex], me.computer);
|
||||||
|
}
|
||||||
|
} elsif (size(navaid) >= 1) {
|
||||||
|
if (canvas_mcdu.myDuplicate[me.computer] != nil) {
|
||||||
|
canvas_mcdu.myDuplicate[me.computer].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDuplicate[me.computer] = nil;
|
||||||
|
canvas_mcdu.myDuplicate[me.computer] = mcdu.duplicateNamesPage.new(navaid, 0, 0, me.computer);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "DUPLICATENAMES");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||||
|
},
|
||||||
|
leftFieldBtn: func(index) {
|
||||||
|
me.makeTmpy();
|
||||||
|
me.L1[0] = me.vector[index + me.scroll - 2].wp_name;
|
||||||
|
fmgc.flightPlanController.directTo(me.vector[index + me.scroll - 2], me.computer);
|
||||||
|
me.arrowsMatrix[0][1] = 0;
|
||||||
|
# FIGURE OUT HOW TO MAKE IT SO IT DOESN'T DELETE THE WAYPOINTS ON DIR TO BUT DOES IN FLIGHTPLAN
|
||||||
|
#for (var i = 2; i != 6; i = i + 1) {
|
||||||
|
# if (i == index) {
|
||||||
|
# me.arrowsMatrix[0][i - 1] = 0;
|
||||||
|
# } else {
|
||||||
|
# me.arrowsMatrix[0][i - 1] = 1;
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
},
|
||||||
|
fieldL6: func() {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer] and dirToFlag) {
|
||||||
|
dirToFlag = 0;
|
||||||
|
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||||
|
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||||
|
},
|
||||||
|
fieldR6: func() {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer] and dirToFlag) {
|
||||||
|
dirToFlag = 0;
|
||||||
|
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
me.L1 = [" [ ]", " WAYPOINT", "blu"];
|
||||||
|
me.R1 = ["---- --- ", "UTC DIST ", "wht"];
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA"); # todo - remember horizontal srcoll of f-plna?
|
||||||
|
},
|
||||||
|
updateDist: func(dist) {
|
||||||
|
me.R1 = ["---- " ~ sprintf("%.0f", dist) ~ " ", "UTC DIST ", "wht"];
|
||||||
|
},
|
||||||
|
};
|
149
Nasal/MCDU/DUPLICATE.nas
Normal file
149
Nasal/MCDU/DUPLICATE.nas
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
var duplicateNamesPage = {
|
||||||
|
title: nil,
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
C1: [nil, nil, "ack"],
|
||||||
|
C2: [nil, nil, "ack"],
|
||||||
|
C3: [nil, nil, "ack"],
|
||||||
|
C4: [nil, nil, "ack"],
|
||||||
|
C5: [nil, nil, "ack"],
|
||||||
|
C6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
vector: nil,
|
||||||
|
type: nil,
|
||||||
|
computer: nil,
|
||||||
|
enableScroll: 0,
|
||||||
|
scroll: 0,
|
||||||
|
distances: nil,
|
||||||
|
new: func(vector, index, type, computer) {
|
||||||
|
var fp = {parents:[duplicateNamesPage]};
|
||||||
|
fp.vector = vector;
|
||||||
|
fp.index = index;
|
||||||
|
fp.type = type; # 0 = other, 1 = navaid
|
||||||
|
fp.computer = computer;
|
||||||
|
fp._setupPageWithData();
|
||||||
|
fp.distances = [];
|
||||||
|
return fp;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
me.title = "DUPLICATE NAMES";
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
|
||||||
|
me.distances = [];
|
||||||
|
for (var i = 0; i < size(me.vector); i += 1) {
|
||||||
|
append(me.distances, math.round(courseAndDistance(me.vector[i])[1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
me.C1[1] = "LAT/LONG";
|
||||||
|
me.R1[1] = "FREQ";
|
||||||
|
if (size(me.vector) >= 1) {
|
||||||
|
me.L1 = [" " ~ me.vector[0 + me.scroll].id, " " ~ me.distances[0 + me.scroll] ~ "NM", "blu"];
|
||||||
|
me.arrowsMatrix[0][0] = 1;
|
||||||
|
me.arrowsColour[0][0] = "blu";
|
||||||
|
me.C1 = [" " ~ decimalToShortString(me.vector[0 + me.scroll].lat, "lat") ~ "/" ~ decimalToShortString(me.vector[0 + me.scroll].lon, "lon"), "LAT/LONG", "grn"];
|
||||||
|
if (me.type == 1) {
|
||||||
|
if (me.vector[0 + me.scroll].frequency != nil) {
|
||||||
|
me.R1 = [sprintf("%7.2f", me.vector[0 + me.scroll].frequency / 100), "FREQ", "grn"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.vector) >= 2) {
|
||||||
|
me.L2 = [" " ~ me.vector[0 + me.scroll].id, " " ~ me.distances[1 + me.scroll] ~ "NM", "blu"];
|
||||||
|
me.arrowsMatrix[0][1] = 1;
|
||||||
|
me.arrowsColour[0][1] = "blu";
|
||||||
|
me.C2 = [" " ~ decimalToShortString(me.vector[1 + me.scroll].lat, "lat") ~ "/" ~ decimalToShortString(me.vector[1 + me.scroll].lon, "lon"), "LAT/LONG", "grn"];
|
||||||
|
if (me.type == 1) {
|
||||||
|
if (me.vector[1 + me.scroll].frequency != nil) {
|
||||||
|
me.R2 = [sprintf("%7.2f", me.vector[1 + me.scroll].frequency / 100), "FREQ", "grn"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.vector) >= 3) {
|
||||||
|
me.L3 = [" " ~ me.vector[0 + me.scroll].id, " " ~ me.distances[2 + me.scroll] ~ "NM", "blu"];
|
||||||
|
me.arrowsMatrix[0][2] = 1;
|
||||||
|
me.arrowsColour[0][2] = "blu";
|
||||||
|
me.C3 = [" " ~ decimalToShortString(me.vector[2 + me.scroll].lat, "lat") ~ "/" ~ decimalToShortString(me.vector[2 + me.scroll].lon, "lon"), "LAT/LONG", "grn"];
|
||||||
|
if (me.type == 1) {
|
||||||
|
if (me.vector[2 + me.scroll].frequency != nil) {
|
||||||
|
me.R3 = [sprintf("%7.2f", me.vector[2 + me.scroll].frequency / 100), "FREQ", "grn"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.vector) >= 4) {
|
||||||
|
me.L4 = [" " ~ me.vector[0 + me.scroll].id, " " ~ me.distances[3 + me.scroll] ~ "NM", "blu"];
|
||||||
|
me.arrowsMatrix[0][3] = 1;
|
||||||
|
me.arrowsColour[0][3] = "blu";
|
||||||
|
me.C4 = [" " ~ decimalToShortString(me.vector[3 + me.scroll].lat, "lat") ~ "/" ~ decimalToShortString(me.vector[3 + me.scroll].lon, "lon"), "LAT/LONG", "grn"];
|
||||||
|
if (me.type == 1) {
|
||||||
|
if (me.vector[3 + me.scroll].frequency != nil) {
|
||||||
|
me.R4 = [sprintf("%7.2f", me.vector[3 + me.scroll].frequency / 100), "FREQ", "grn"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.vector) >= 5) {
|
||||||
|
me.L5 = [" " ~ me.vector[0 + me.scroll].id, " " ~ me.distances[4 + me.scroll] ~ "NM", "blu"];
|
||||||
|
me.arrowsMatrix[0][4] = 1;
|
||||||
|
me.arrowsColour[0][4] = "blu";
|
||||||
|
me.C5 = [" " ~ decimalToShortString(me.vector[4 + me.scroll].lat, "lat") ~ "/" ~ decimalToShortString(me.vector[4 + me.scroll].lon, "lon"), "LAT/LONG", "grn"];
|
||||||
|
if (me.type == 1) {
|
||||||
|
if (me.vector[4 + me.scroll].frequency != nil) {
|
||||||
|
me.R5 = [sprintf("%7.2f", me.vector[4 + me.scroll].frequency / 100), "FREQ", "grn"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (size(me.vector) > 5) { me.enableScroll = 1; }
|
||||||
|
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
},
|
||||||
|
scrollUp: func() {
|
||||||
|
if (me.enableScroll) {
|
||||||
|
me.scroll += 1;
|
||||||
|
if (me.scroll > size(me.vector) - 5) {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollDn: func() {
|
||||||
|
if (me.enableScroll) {
|
||||||
|
me.scroll -= 1;
|
||||||
|
if (me.scroll < 0) {
|
||||||
|
me.scroll = size(me.vector) - 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pushButtonLeft: func(indexSelect) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
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");
|
||||||
|
} elsif (size(me.vector[0].id) == 4) {
|
||||||
|
fmgc.flightPlanController.insertAirport(me.vector[0].id, me.index, me.computer, 1, indexSelect - 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
|
||||||
|
} elsif (size(me.vector[0].id) == 3 or size(me.vector[0].id)== 2) {
|
||||||
|
fmgc.flightPlanController.insertNavaid(me.vector[0].id, me.index, me.computer, 1, indexSelect - 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
canvas_mcdu.myDirTo[me.computer].fieldL1(me.vector[0].id, 1, indexSelect - 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "DIRTO");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
424
Nasal/MCDU/F-PLN.nas
Normal file
424
Nasal/MCDU/F-PLN.nas
Normal file
|
@ -0,0 +1,424 @@
|
||||||
|
var fplnItem = {
|
||||||
|
new: func(wp, index, plan, computer, colour = "grn") {
|
||||||
|
var fI = {parents:[fplnItem]};
|
||||||
|
fI.wp = wp;
|
||||||
|
fI.index = index;
|
||||||
|
fI.plan = plan;
|
||||||
|
fI.computer = computer;
|
||||||
|
fI.colour = colour;
|
||||||
|
return fI;
|
||||||
|
},
|
||||||
|
updateLeftText: func() {
|
||||||
|
if (me.wp != nil) {
|
||||||
|
if (me.wp.wp_name == "T-P") {
|
||||||
|
return ["T-P", nil, me.colour];
|
||||||
|
} elsif (me.wp.wp_name != "DISCONTINUITY") {
|
||||||
|
var wptName = split("-", me.wp.wp_name);
|
||||||
|
if (wptName[0] == "VECTORS") {
|
||||||
|
return ["MANUAL", nil, me.colour];
|
||||||
|
} else {
|
||||||
|
if (size(wptName) == 2) {
|
||||||
|
return[wptName[0] ~ wptName[1], nil, me.colour];
|
||||||
|
} else {
|
||||||
|
return [me.wp.wp_name, nil, me.colour];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ["problem", nil, "ack"];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateCenterText: func() {
|
||||||
|
if (me.wp != nil) {
|
||||||
|
if (me.wp.wp_name != "DISCONTINUITY") {
|
||||||
|
if (me.index != (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) or fmgc.flightPlanController.fromWptTime == nil) {
|
||||||
|
me.brg = me.getBrg();
|
||||||
|
me.track = me.getTrack();
|
||||||
|
return ["---- ", nil, me.colour];
|
||||||
|
} else {
|
||||||
|
me.brg = me.getBrg();
|
||||||
|
me.track = me.getTrack();
|
||||||
|
return [fmgc.flightPlanController.fromWptTime ~ " ", nil, me.colour];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ["---F-PLN DISCONTINUITY--", nil, "wht"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ["problem", nil, "ack"];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateRightText: func() {
|
||||||
|
if (me.wp != nil) {
|
||||||
|
if (me.wp.wp_name != "DISCONTINUITY") {
|
||||||
|
me.spd = me.getSpd();
|
||||||
|
me.alt = me.getAlt();
|
||||||
|
me.dist = me.getDist();
|
||||||
|
return [me.spd ~ "/" ~ me.alt, " " ~ me.dist ~ "NM ", me.colour];
|
||||||
|
} else {
|
||||||
|
return [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ["problem", nil, "ack"];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getBrg: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
getTrack: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
getSpd: func() {
|
||||||
|
return "---";
|
||||||
|
},
|
||||||
|
getAlt: func() {
|
||||||
|
if (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) {
|
||||||
|
return " " ~ fmgc.flightPlanController.fromWptAlt;
|
||||||
|
} else {
|
||||||
|
return "-----";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDist: func() {
|
||||||
|
return "--";
|
||||||
|
},
|
||||||
|
pushButtonLeft: func() {
|
||||||
|
if (canvas_mcdu.myLatRev[me.computer] != nil) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = nil;
|
||||||
|
|
||||||
|
if (me.wp.wp_name == "DISCONTINUITY") {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(4, "DISCON", me.index, me.computer);
|
||||||
|
} elsif (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (me.index == fmgc.flightPlanController.arrivalIndex[me.computer]) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
|
||||||
|
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer);
|
||||||
|
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(2, me.wp.wp_name, me.index, me.computer);
|
||||||
|
} else {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(3, me.wp.wp_name, me.index, me.computer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.index == fmgc.flightPlanController.arrivalIndex[2]) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
|
||||||
|
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[2].departure.id) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(0, left(me.wp.wp_name, 4), me.index, me.computer);
|
||||||
|
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(2, me.wp.wp_name, me.index, me.computer);
|
||||||
|
} else {
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(3, me.wp.wp_name, me.index, me.computer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "LATREV");
|
||||||
|
},
|
||||||
|
pushButtonRight: func() {
|
||||||
|
if (canvas_mcdu.myVertRev[me.computer] != nil) {
|
||||||
|
canvas_mcdu.myVertRev[me.computer].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = nil;
|
||||||
|
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (me.index == fmgc.flightPlanController.arrivalIndex[me.computer]) {
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
|
||||||
|
} if (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[me.computer].departure.id) {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
return;
|
||||||
|
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer);
|
||||||
|
} else {
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (me.index == fmgc.flightPlanController.arrivalIndex[2]) {
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = vertRev.new(1, left(me.wp.wp_name, 4), me.index, me.computer);
|
||||||
|
} elsif (left(me.wp.wp_name, 4) == fmgc.flightPlanController.flightplans[2].departure.id) {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
return;
|
||||||
|
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1)) {
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = vertRev.new(3, me.wp.wp_name, me.index, me.computer);
|
||||||
|
} else {
|
||||||
|
canvas_mcdu.myVertRev[me.computer] = vertRev.new(2, me.wp.wp_name, me.index, me.computer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "VERTREV");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var staticText = {
|
||||||
|
new: func(computer, text) {
|
||||||
|
var sT = {parents:[staticText]};
|
||||||
|
sT.computer = computer;
|
||||||
|
sT.text = text;
|
||||||
|
return sT;
|
||||||
|
},
|
||||||
|
updateLeftText: func() {
|
||||||
|
return [nil, nil, "ack"];
|
||||||
|
},
|
||||||
|
updateCenterText: func() {
|
||||||
|
return [me.text, nil, "wht"];
|
||||||
|
},
|
||||||
|
updateRightText: func() {
|
||||||
|
return [nil, nil, "ack"];
|
||||||
|
},
|
||||||
|
pushButtonLeft: func() {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
},
|
||||||
|
pushButtonRight: func() {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var fplnPage = { # this one is only created once, and then updated - remember this
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
C1: [nil, nil, "ack"],
|
||||||
|
C2: [nil, nil, "ack"],
|
||||||
|
C3: [nil, nil, "ack"],
|
||||||
|
C4: [nil, nil, "ack"],
|
||||||
|
C5: [nil, nil, "ack"],
|
||||||
|
C6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
|
||||||
|
# init conditions
|
||||||
|
# line 1 = FROM
|
||||||
|
# line 2 = TO
|
||||||
|
# line 6 = DEST
|
||||||
|
# neither pseudo nor markers may be FROM waypoint
|
||||||
|
# bearing between FROM and TO waypoints
|
||||||
|
# track between line 2 and line 3 waypoints
|
||||||
|
# name of LEG above TO waypoint - is airway identifier, or waypoint name
|
||||||
|
|
||||||
|
# DEST in LINE 6 time prediction, distance along flightplan, and EFOB
|
||||||
|
# dashes if no predictions
|
||||||
|
planList: [],
|
||||||
|
outputList: [],
|
||||||
|
scroll: 0,
|
||||||
|
temporaryFlagFpln: 0,
|
||||||
|
new: func(plan, computer) {
|
||||||
|
var fp = {parents:[fplnPage]};
|
||||||
|
fp.plan = fmgc.flightPlanController.flightplans[plan];
|
||||||
|
fp.planIndex = plan;
|
||||||
|
fp.computer = computer;
|
||||||
|
fp.planList = [];
|
||||||
|
fp.outputList = [];
|
||||||
|
return fp;
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
me.destInfo();
|
||||||
|
me.createPlanList();
|
||||||
|
},
|
||||||
|
updatePlan: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.planIndex = 2;
|
||||||
|
me.plan = fmgc.flightPlanController.flightplans[2];
|
||||||
|
me.temporaryFlagFpln = 0;
|
||||||
|
} else {
|
||||||
|
me.planIndex = me.computer;
|
||||||
|
me.plan = fmgc.flightPlanController.flightplans[me.computer];
|
||||||
|
me.temporaryFlagFpln = 1;
|
||||||
|
}
|
||||||
|
me._setupPageWithData();
|
||||||
|
},
|
||||||
|
getText: func(type) {
|
||||||
|
if (type == "fplnEnd") {
|
||||||
|
return "------END OF F-PLN------";
|
||||||
|
} else if (type == "altnFplnEnd") {
|
||||||
|
return "----END OF ALTN F-PLN---";
|
||||||
|
} else if (type == "noAltnFpln") {
|
||||||
|
return "------NO ALTN F-PLN-----";
|
||||||
|
} else if (type == "empty") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createPlanList: func() {
|
||||||
|
me.planList = [];
|
||||||
|
if (me.temporaryFlagFpln) {
|
||||||
|
for (var i = 0; i < me.plan.getPlanSize(); i += 1) {
|
||||||
|
append(me.planList, fplnItem.new(me.plan.getWP(i), i, me.plan, me.computer, "yel"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (var i = 0; i < me.plan.getPlanSize(); i += 1) {
|
||||||
|
append(me.planList, fplnItem.new(me.plan.getWP(i), i, me.plan, me.computer));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
append(me.planList, staticText.new(me.computer, me.getText("fplnEnd")));
|
||||||
|
append(me.planList, staticText.new(me.computer, me.getText("noAltnFpln")));
|
||||||
|
me.basePage();
|
||||||
|
},
|
||||||
|
basePage: func() {
|
||||||
|
me.outputList = [];
|
||||||
|
for (var i = 0; i + me.scroll < size(me.planList); i += 1) {
|
||||||
|
append(me.outputList, me.planList[i + me.scroll] );
|
||||||
|
}
|
||||||
|
if (size(me.outputList) >= 1) {
|
||||||
|
me.L1 = me.outputList[0].updateLeftText();
|
||||||
|
me.C1 = me.outputList[0].updateCenterText();
|
||||||
|
me.C1[1] = "TIME ";
|
||||||
|
me.R1 = me.outputList[0].updateRightText();
|
||||||
|
me.R1[1] = "SPD/ALT ";
|
||||||
|
} else {
|
||||||
|
me.L1 = [nil, nil, "ack"];
|
||||||
|
me.C1 = [nil, nil, "ack"];
|
||||||
|
me.R1 = [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
if (size(me.outputList) >= 2) {
|
||||||
|
me.L2 = me.outputList[1].updateLeftText();
|
||||||
|
me.C2 = me.outputList[1].updateCenterText();
|
||||||
|
me.R2 = me.outputList[1].updateRightText();
|
||||||
|
} else {
|
||||||
|
me.L2 = [nil, nil, "ack"];
|
||||||
|
me.C2 = [nil, nil, "ack"];
|
||||||
|
me.R2 = [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
if (size(me.outputList) >= 3) {
|
||||||
|
me.L3 = me.outputList[2].updateLeftText();
|
||||||
|
me.C3 = me.outputList[2].updateCenterText();
|
||||||
|
me.R3 = me.outputList[2].updateRightText();
|
||||||
|
} else {
|
||||||
|
me.L3 = [nil, nil, "ack"];
|
||||||
|
me.C3 = [nil, nil, "ack"];
|
||||||
|
me.R3 = [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
if (size(me.outputList) >= 4) {
|
||||||
|
me.L4 = me.outputList[3].updateLeftText();
|
||||||
|
me.C4 = me.outputList[3].updateCenterText();
|
||||||
|
me.R4 = me.outputList[3].updateRightText();
|
||||||
|
} else {
|
||||||
|
me.L4 = [nil, nil, "ack"];
|
||||||
|
me.C4 = [nil, nil, "ack"];
|
||||||
|
me.R4 = [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
if (size(me.outputList) >= 5) {
|
||||||
|
me.L5 = me.outputList[4].updateLeftText();
|
||||||
|
me.C5 = me.outputList[4].updateCenterText();
|
||||||
|
me.R5 = me.outputList[4].updateRightText();
|
||||||
|
} else {
|
||||||
|
me.L5 = [nil, nil, "ack"];
|
||||||
|
me.C5 = [nil, nil, "ack"];
|
||||||
|
me.R5 = [nil, nil, "ack"];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destInfo: func() {
|
||||||
|
if (me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]) != nil) {
|
||||||
|
me.L6 = [left(me.plan.getWP(fmgc.flightPlanController.arrivalIndex[me.planIndex]).wp_name, 4), " DEST", "wht"];
|
||||||
|
} else {
|
||||||
|
me.L6 = ["----", " DEST", "wht"];
|
||||||
|
}
|
||||||
|
if (fmgc.flightPlanController.arrivalDist != nil) {
|
||||||
|
me.C6 = ["---- " ~ int(fmgc.flightPlanController.arrivalDist), "TIME DIST", "wht"];
|
||||||
|
} else {
|
||||||
|
me.C6 = ["---- ----", "TIME DIST", "wht"];
|
||||||
|
}
|
||||||
|
me.R6 = ["--.-", "EFOB", "wht"];
|
||||||
|
},
|
||||||
|
update: func() {
|
||||||
|
#me.basePage();
|
||||||
|
},
|
||||||
|
scrollUp: func() {
|
||||||
|
if (size(me.planList) > 5) {
|
||||||
|
me.scroll += 1;
|
||||||
|
if (me.scroll > size(me.planList) - 5) {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollDn: func() {
|
||||||
|
if (size(me.planList) > 5) {
|
||||||
|
me.scroll -= 1;
|
||||||
|
if (me.scroll < 0) {
|
||||||
|
me.scroll = size(me.planList) - 5;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.scroll = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pushButtonLeft: func(index) {
|
||||||
|
if (index == 6) {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 0);
|
||||||
|
} else {
|
||||||
|
if (canvas_mcdu.myLatRev[me.computer] != nil) {
|
||||||
|
canvas_mcdu.myLatRev[me.computer].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = nil;
|
||||||
|
canvas_mcdu.myLatRev[me.computer] = latRev.new(1, me.L6[0], fmgc.flightPlanController.arrivalIndex[me.computer], me.computer);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/page", "LATREV");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (size(me.outputList) >= index) {
|
||||||
|
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
|
||||||
|
var returny = fmgc.flightPlanController.scratchpad(getprop("MCDU[" ~ me.computer ~ "]/scratchpad"), (index - 1 + me.scroll), me.computer);
|
||||||
|
if (returny == 3) {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
} elsif (returny == 0) {
|
||||||
|
notInDataBase(me.computer);
|
||||||
|
} elsif (returny == 1) {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
me.outputList[index - 1].pushButtonLeft();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pushButtonRight: func(index) {
|
||||||
|
if (index == 6) {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (dirToFlag) { dirToFlag = 0; }
|
||||||
|
fmgc.flightPlanController.destroyTemporaryFlightPlan(me.computer, 1);
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (size(me.outputList) >= index) {
|
||||||
|
if (size(getprop("MCDU[" ~ me.computer ~ "]/scratchpad")) > 0) {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
} else {
|
||||||
|
me.outputList[index - 1].pushButtonRight();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var notInDataBase = func(i) {
|
||||||
|
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "NOT IN DATABASE");
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||||
|
}
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "NOT IN DATABASE");
|
||||||
|
}
|
||||||
|
|
||||||
|
var decimalToShortString = func(dms, type) {
|
||||||
|
var degrees = split(".", sprintf(dms))[0];
|
||||||
|
if (type == "lat") {
|
||||||
|
var sign = degrees >= 0 ? "N" : "S";
|
||||||
|
} else {
|
||||||
|
var sign = degrees >= 0 ? "E" : "W";
|
||||||
|
}
|
||||||
|
return abs(degrees) ~ sign;
|
||||||
|
}
|
76
Nasal/MCDU/HOLD.nas
Normal file
76
Nasal/MCDU/HOLD.nas
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
var holdPage = {
|
||||||
|
title: [nil, nil, nil],
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
C1: [nil, nil, "ack"],
|
||||||
|
C2: [nil, nil, "ack"],
|
||||||
|
C3: [nil, nil, "ack"],
|
||||||
|
C4: [nil, nil, "ack"],
|
||||||
|
C5: [nil, nil, "ack"],
|
||||||
|
C6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
scroll: 0,
|
||||||
|
vector: [],
|
||||||
|
index: nil,
|
||||||
|
computer: nil,
|
||||||
|
new: func(computer, waypoint) {
|
||||||
|
var hp = {parents:[holdPage]};
|
||||||
|
hp.computer = computer;
|
||||||
|
hp.waypoint = waypoint;
|
||||||
|
hp.updateTmpy();
|
||||||
|
hp._setupPageWithData();
|
||||||
|
return hp;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
# me.title = ["LAT REV", " AT ", me.waypoint.wp_name]; TODO FIXME LATREV
|
||||||
|
me.title = ["HOLD", " AT ", me.waypoint];
|
||||||
|
me.titleColour = "wht";
|
||||||
|
me.L1 = [" [ ]", " INB CRS", "blu"];
|
||||||
|
me.L2 = [" R", " TURN", "blu"];
|
||||||
|
if (pts.Instrumentation.Altimeter.indicatedFt.getValue() >= 14000) {
|
||||||
|
me.L2 = [" 1.5/----", "TIME/DIST", "blu"];
|
||||||
|
} else {
|
||||||
|
me.L2 = [" 1.0/----", "TIME/DIST", "blu"];
|
||||||
|
}
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.C4 = ["LAST EXIT", nil, "wht"];
|
||||||
|
me.C5 = ["---- ---.-", "UTC FUEL", "wht"];
|
||||||
|
me.R1 = ["COMPUTED ", nil, "blu"];
|
||||||
|
me.R2 = ["DATABASE ", nil, "blu"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["blu", "blu", "ack", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
},
|
||||||
|
makeTmpy: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateTmpy: func() {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
me.R2[2] = "yel";
|
||||||
|
me.R3[2] = "yel";
|
||||||
|
me.R4[2] = "yel";
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -70,12 +70,13 @@ var initInputA = func(key, i) {
|
||||||
}
|
}
|
||||||
} else if (key == "R1") {
|
} else if (key == "R1") {
|
||||||
if (scratchpad == "CLR") {
|
if (scratchpad == "CLR") {
|
||||||
setprop("FMGC/internal/dep-arpt", "");
|
clearFPLNComputer();
|
||||||
setprop("FMGC/internal/arr-arpt", "");
|
setprop("/FMGC/internal/dep-arpt", "");
|
||||||
setprop("FMGC/internal/tofrom-set", 0);
|
setprop("/FMGC/internal/arr-arpt", "");
|
||||||
fmgc.updateARPT();
|
setprop("/FMGC/internal/tofrom-set", 0);
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
fmgc.flightPlanController.reset();
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
setprop("/MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||||
|
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||||
} else {
|
} else {
|
||||||
var tfs = size(scratchpad);
|
var tfs = size(scratchpad);
|
||||||
if (tfs == 9 and find("/", scratchpad) != -1) {
|
if (tfs == 9 and find("/", scratchpad) != -1) {
|
||||||
|
@ -83,11 +84,11 @@ var initInputA = func(key, i) {
|
||||||
var froms = size(fromto[0]);
|
var froms = size(fromto[0]);
|
||||||
var tos = size(fromto[1]);
|
var tos = size(fromto[1]);
|
||||||
if (froms == 4 and tos == 4) {
|
if (froms == 4 and tos == 4) {
|
||||||
setprop("FMGC/internal/dep-arpt", fromto[0]);
|
setprop("/FMGC/internal/dep-arpt", fromto[0]);
|
||||||
setprop("FMGC/internal/arr-arpt", fromto[1]);
|
setprop("/FMGC/internal/arr-arpt", fromto[1]);
|
||||||
setprop("FMGC/internal/tofrom-set", 1);
|
setprop("/FMGC/internal/tofrom-set", 1);
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "");
|
setprop("/MCDU[" ~ i ~ "]/scratchpad", "");
|
||||||
fmgc.updateARPT();
|
fmgc.flightPlanController.updateAirports(fromto[0], fromto[1], 2);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
|
|
191
Nasal/MCDU/LATREV.nas
Normal file
191
Nasal/MCDU/LATREV.nas
Normal file
|
@ -0,0 +1,191 @@
|
||||||
|
var latRev = {
|
||||||
|
title: [nil, nil, nil],
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
depAirport: nil,
|
||||||
|
arrAirport: nil,
|
||||||
|
index: nil,
|
||||||
|
computer: nil,
|
||||||
|
new: func(type, id, index, computer) {
|
||||||
|
var lr = {parents:[latRev]};
|
||||||
|
lr.type = type; # 0 = origin 1 = destination 2 = ppos (from waypoint) 3 = generic wpt, 4 = discon
|
||||||
|
lr.id = id;
|
||||||
|
lr.index = index;
|
||||||
|
lr.computer = computer;
|
||||||
|
lr._setupPageWithData();
|
||||||
|
lr._checkTmpy();
|
||||||
|
return lr;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_checkTmpy: func() {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
me.R2[2] = "yel";
|
||||||
|
me.R3[2] = "yel";
|
||||||
|
me.R4[2] = "yel";
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
if (me.type == 2) {
|
||||||
|
me.title = ["LAT REV", " FROM ", "PPOS"];
|
||||||
|
me.L2 = [" OFFSET", nil, "wht"];
|
||||||
|
me.L3 = [" HOLD", nil, "wht"];
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.R1 = ["FIX INFO ", nil, "wht"];
|
||||||
|
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
|
||||||
|
me.arrowsMatrix = [[0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "wht", "wht", "ack", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0]];
|
||||||
|
} elsif (me.type == 4) {
|
||||||
|
me.title = ["LAT REV", " FROM ", "DISCON"];
|
||||||
|
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
|
||||||
|
me.R4 = ["[ ]", "NEW DEST", "blu"];
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "ack", "ack", "wht"], ["ack", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0]];
|
||||||
|
} else {
|
||||||
|
me.title = ["LAT REV", " FROM ", me.id];
|
||||||
|
|
||||||
|
if (me.type == 0) {
|
||||||
|
if (size(me.id) > 4) {
|
||||||
|
me.depAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
} else {
|
||||||
|
me.depAirport = findAirportsByICAO(me.id);
|
||||||
|
}
|
||||||
|
me.subtitle = [dmsToString(sprintf(me.depAirport[0].lat), "lat"), dmsToString(sprintf(me.depAirport[0].lon), "lon")];
|
||||||
|
me.L1 = [" DEPARTURE", nil, "wht"];
|
||||||
|
me.L2 = [" OFFSET", nil, "wht"];
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.R1 = ["FIX INFO ", nil, "wht"];
|
||||||
|
me.R2 = ["[ ]°/[ ]°/[ ]", "LL XING/INCR/NO", "blu"];
|
||||||
|
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
|
||||||
|
me.R4 = ["[ ]", "NEW DEST", "blu"];
|
||||||
|
me.arrowsMatrix = [[1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["wht", "wht", "ack", "ack", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 0, 0]];
|
||||||
|
} elsif (me.type == 1) {
|
||||||
|
if (size(me.id) > 4) {
|
||||||
|
me.arrAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
} else {
|
||||||
|
me.arrAirport = findAirportsByICAO(me.id);
|
||||||
|
}
|
||||||
|
me.subtitle = [dmsToString(sprintf(me.arrAirport[0].lat), "lat"), dmsToString(sprintf(me.arrAirport[0].lon), "lon")];
|
||||||
|
me.L3 = [" ALTN", nil, "wht"];
|
||||||
|
me.L4 = [" ALTN", " ENABLE", "blu"];
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.R1 = ["ARRIVAL ", nil, "wht"];
|
||||||
|
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "wht", "blu", "ack", "wht"], ["wht", "ack", "ack", "ack", "ack", "ack"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0]];
|
||||||
|
} elsif (me.type == 3) {
|
||||||
|
if (size(me.id) == 2 or size(me.id) == 3) {
|
||||||
|
me.wpt = findNavaidsByID(me.id);
|
||||||
|
} elsif (size(me.id) == 4) {
|
||||||
|
me.wpt = findAirportsByICAO(me.id);
|
||||||
|
} elsif (size(me.id) == 5) {
|
||||||
|
me.wpt = findFixesByID(me.id);
|
||||||
|
}
|
||||||
|
if (me.wpt[0] != nil) {
|
||||||
|
me.subtitle = [dmsToString(sprintf(me.wpt[0].lat), "lat"), dmsToString(sprintf(me.wpt[0].lon), "lon")];
|
||||||
|
}
|
||||||
|
me.L3 = [" HOLD", nil, "wht"];
|
||||||
|
me.L4 = [" ALTN", " ENABLE", "blu"];
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.R1 = ["FIX INFO ", nil, "wht"];
|
||||||
|
me.R3 = ["[ ]", "NEXT WPT ", "blu"];
|
||||||
|
me.R4 = ["[ ]", "NEW DEST", "blu"];
|
||||||
|
me.R5 = ["AIRWAYS ", nil, "wht"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 1, 1, 0, 1], [1, 0, 0, 0, 1, 0]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "wht", "blu", "ack", "wht"], ["wht", "ack", "ack", "ack", "wht", "ack"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeTmpy: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
me._checkTmpy();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nextWpt: func() {
|
||||||
|
me.makeTmpy();
|
||||||
|
|
||||||
|
var returny = fmgc.flightPlanController.scratchpad(getprop("/MCDU[" ~ me.computer ~ "]/scratchpad"), me.index + 1, me.computer);
|
||||||
|
if (returny == 0) {
|
||||||
|
notInDataBase(me.computer);
|
||||||
|
} elsif (returny == 1) {
|
||||||
|
notAllowed(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("/MCDU[" ~ me.computer ~ "]/scratchpad-msg", "");
|
||||||
|
setprop("/MCDU[" ~ me.computer ~ "]/scratchpad", "");
|
||||||
|
fmgc.flightPlanController.flightPlanChanged(me.computer);
|
||||||
|
if (getprop("/MCDU[" ~ me.computer ~ "]/page") != "DUPLICATENAMES") {
|
||||||
|
setprop("/MCDU[" ~ me.computer ~ "]/page", "F-PLNA");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var dmsToString = func(dms, type) {
|
||||||
|
var degrees = int(dms);
|
||||||
|
var minutes = sprintf("%.1f",abs((dms - degrees) * 60));
|
||||||
|
if (type == "lat") {
|
||||||
|
var sign = degrees >= 0 ? "N" : "S";
|
||||||
|
} else {
|
||||||
|
var sign = degrees >= 0 ? "E" : "W";
|
||||||
|
}
|
||||||
|
return abs(degrees) ~ "g" ~ minutes ~ " " ~ sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var stringToDegrees = func(string, type) {
|
||||||
|
if (type == "lat") {
|
||||||
|
var degrees = left(string, 2);
|
||||||
|
var minutesStr = right(string, 5);
|
||||||
|
} else {
|
||||||
|
var degrees = left(string, 3);
|
||||||
|
var minutesStr = right(string, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
var minutes = left(minutesStr, 4);
|
||||||
|
var sign = right(minutesStr, 1);
|
||||||
|
var decimal = degrees + (minutes / 60);
|
||||||
|
if (type == "lat") {
|
||||||
|
if (sign == "N") {
|
||||||
|
return decimal;
|
||||||
|
} else {
|
||||||
|
return -decimal;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (sign == "E") {
|
||||||
|
return decimal;
|
||||||
|
} else {
|
||||||
|
return -decimal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -103,59 +103,107 @@ var lskbutton = func(btn, i) {
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 0);
|
||||||
}
|
}
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("L1",i);
|
perfTOInput("L1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("L1",i);
|
perfAPPRInput("L1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("L1",i);
|
radnavInput("L1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||||
dataInput("L1",i);
|
dataInput("L1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("L1",i);
|
printInput("L1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("L1",i);
|
printInput2("L1", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
|
||||||
|
if (canvas_mcdu.myLatRev[i].type == 0) {
|
||||||
|
if (canvas_mcdu.myDeparture[i] != nil) {
|
||||||
|
canvas_mcdu.myDeparture[i].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myDeparture[i] = nil;
|
||||||
|
canvas_mcdu.myDeparture[i] = departurePage.new(canvas_mcdu.myLatRev[i].title[2], i);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "DEPARTURE");
|
||||||
|
} else {
|
||||||
|
notAllowed(i);
|
||||||
|
}
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonLeft(1);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].fieldL1(getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||||
|
canvas_mcdu.myDuplicate[i].pushButtonLeft(1);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "2") {
|
} else if (btn == "2") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
PerfInput("L2",i);
|
PerfInput("L2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("L2",i);
|
perfTOInput("L2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("L2",i);
|
perfAPPRInput("L2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("L2",i);
|
radnavInput("L2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||||
initInputA("L5",i); # Does the same thing as on the INIT page
|
initInputA("L5", i); # Does the same thing as on the INIT page
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||||
initInputA("L5",i);
|
initInputA("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
||||||
initInputA("L5",i);
|
initInputA("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||||
dataInput("L2",i);
|
dataInput("L2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("L2",i);
|
printInput("L2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("L2",i);
|
printInput2("L2", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonLeft(2);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonLeft(2);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonLeft(2);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].leftFieldBtn(2);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||||
|
canvas_mcdu.myDuplicate[i].pushButtonLeft(2);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "3") {
|
} else if (btn == "3") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
initInputA("L3",i);
|
initInputA("L3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("L3",i);
|
perfTOInput("L3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("L3",i);
|
perfAPPRInput("L3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "STATUS") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "STATUS") {
|
||||||
statusInput("L3",i);
|
statusInput("L3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("L3",i);
|
radnavInput("L3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("L3",i);
|
printInput("L3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("L3",i);
|
printInput2("L3", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonLeft(3);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonLeft(3);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonLeft(3);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].leftFieldBtn(3);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
|
||||||
|
if (canvas_mcdu.myLatRev[i].type != 0 and canvas_mcdu.myLatRev[i].type != 1) {
|
||||||
|
if (canvas_mcdu.myHold[i] != nil) {
|
||||||
|
canvas_mcdu.myHold[i].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myHold[i] = nil;
|
||||||
|
canvas_mcdu.myHold[i] = holdPage.new(i, canvas_mcdu.myLatRev[i].id);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "HOLD");
|
||||||
|
} else {
|
||||||
|
notAllowed(i);
|
||||||
|
}
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||||
|
canvas_mcdu.myDuplicate[i].pushButtonLeft(3);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
|
@ -163,55 +211,87 @@ var lskbutton = func(btn, i) {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "STATUS");
|
setprop("MCDU[" ~ i ~ "]/page", "STATUS");
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("L4",i);
|
perfTOInput("L4", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("L4",i);
|
perfAPPRInput("L4", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("L4",i);
|
radnavInput("L4", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("L4",i);
|
printInput2("L4", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonLeft(4);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonLeft(4);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonLeft(4);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].leftFieldBtn(4);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||||
|
canvas_mcdu.myDuplicate[i].pushButtonLeft(4);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "5") {
|
} else if (btn == "5") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
initInputA("L5",i);
|
initInputA("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("L5",i);
|
perfTOInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||||
perfCLBInput("L5",i);
|
perfCLBInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||||
perfCRZInput("L5",i);
|
perfCRZInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
||||||
perfDESInput("L5",i);
|
perfDESInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("L5",i);
|
perfAPPRInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
|
||||||
perfGAInput("L5",i);
|
perfGAInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("L5",i);
|
radnavInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("L5",i);
|
printInput("L5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("L5",i);
|
printInput2("L5", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonLeft(5);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonLeft(5);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonLeft(5);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].leftFieldBtn(5);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||||
|
canvas_mcdu.myDuplicate[i].pushButtonLeft(5);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "6") {
|
} else if (btn == "6") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
initInputA("L6",i);
|
initInputA("L6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||||
perfCLBInput("L6",i);
|
perfCLBInput("L6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||||
perfCRZInput("L6",i);
|
perfCRZInput("L6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
||||||
perfDESInput("L6",i);
|
perfDESInput("L6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("L6",i);
|
perfAPPRInput("L6",i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
|
||||||
perfGAInput("L6",i);
|
perfGAInput("L6",i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("L6",i);
|
printInput2("L6", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonLeft(6);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV" or getprop("MCDU[" ~ i ~ "]/page") == "VERTREV" or getprop("MCDU[" ~ i ~ "]/page") == "DUPLICATENAMES") {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE" or getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL" or getprop("MCDU[" ~ i ~ "]/page") == "HOLD") {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[i]) {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "LATREV");
|
||||||
|
}
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].fieldL6();
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
|
@ -225,67 +305,110 @@ var lskbutton_b = func(btn, i) {
|
||||||
var rskbutton = func(btn, i) {
|
var rskbutton = func(btn, i) {
|
||||||
if (btn == "1") {
|
if (btn == "1") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
initInputA("R1",i);
|
initInputA("R1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||||
initInputB("R1",i);
|
initInputB("R1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("R1",i);
|
radnavInput("R1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("R1",i);
|
printInput("R1", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("R1",i);
|
printInput2("R1", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
|
||||||
|
if (canvas_mcdu.myLatRev[i].type == 1) {
|
||||||
|
if (canvas_mcdu.myArrival[i] != nil) {
|
||||||
|
canvas_mcdu.myArrival[i].del();
|
||||||
|
}
|
||||||
|
canvas_mcdu.myArrival[i] = nil;
|
||||||
|
canvas_mcdu.myArrival[i] = arrivalPage.new(canvas_mcdu.myLatRev[i].title[2], i);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "ARRIVAL");
|
||||||
|
} else {
|
||||||
|
notAllowed(i);
|
||||||
|
}
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonRight(1);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "2") {
|
} else if (btn == "2") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||||
initInputB("R2",i);
|
initInputB("R2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("R2",i);
|
perfAPPRInput("R2",i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("R2",i);
|
radnavInput("R2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("R2",i);
|
printInput("R2", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("R2",i);
|
printInput2("R2", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonRight(2);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonRight(2);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonRight(2);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "3") {
|
} else if (btn == "3") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
initInputA("R3",i);
|
initInputA("R3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("R3",i);
|
perfTOInput("R3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("R3",i);
|
perfAPPRInput("R3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
printInput("R3",i);
|
printInput("R3", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("R3",i);
|
printInput2("R3", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonRight(3);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonRight(3);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "LATREV") {
|
||||||
|
if (canvas_mcdu.myLatRev[i].type != 2) {
|
||||||
|
canvas_mcdu.myLatRev[i].nextWpt();
|
||||||
|
} else {
|
||||||
|
notAllowed(i);
|
||||||
|
}
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonRight(3);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "4") {
|
} else if (btn == "4") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("R4",i);
|
perfTOInput("R4", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("R4",i);
|
perfAPPRInput("R4", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("R4",i);
|
radnavInput("R4", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
printInput2("R4",i);
|
printInput2("R4", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonRight(4);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonRight(4);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonRight(4);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (btn == "5") {
|
} else if (btn == "5") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("R5",i);
|
perfTOInput("R5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "GA") {
|
||||||
perfGAInput("R5",i);
|
perfGAInput("R5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "RADNAV") {
|
||||||
radnavInput("R5",i);
|
radnavInput("R5", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||||
dataInput("R5",i);
|
dataInput("R5", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].depPushbuttonRight(5);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].arrPushbuttonRight(5);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonRight(5);
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
|
@ -299,15 +422,15 @@ var rskbutton = func(btn, i) {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "TO") {
|
||||||
perfTOInput("R6",i);
|
perfTOInput("R6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CLB") {
|
||||||
perfCLBInput("R6",i);
|
perfCLBInput("R6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "CRZ") {
|
||||||
perfCRZInput("R6",i);
|
perfCRZInput("R6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DES") {
|
||||||
perfDESInput("R6",i);
|
perfDESInput("R6", i);
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "APPR") {
|
||||||
perfAPPRInput("R6",i);
|
perfAPPRInput("R6", i);
|
||||||
} else if ((getprop("MCDU[" ~ i ~ "]/page") == "DATA") or (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") or (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2")) {
|
} else if ((getprop("MCDU[" ~ i ~ "]/page") == "DATA") or (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") or (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2")) {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "AOC DISABLED") {
|
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "AOC DISABLED") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||||
|
@ -319,7 +442,13 @@ var rskbutton = func(btn, i) {
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "AOC DISABLED");
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "AOC DISABLED");
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
initInputA("R6",i);
|
initInputA("R6", i);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].pushButtonRight(6);
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "VERTREV") {
|
||||||
|
setprop("MCDU/[" ~ i ~ "]/page", "F-PLNA");
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].fieldR6();
|
||||||
} else {
|
} else {
|
||||||
notAllowed(i);
|
notAllowed(i);
|
||||||
}
|
}
|
||||||
|
@ -336,41 +465,61 @@ var arrowbutton = func(btn, i) {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
|
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
||||||
}
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("/engines/engine[0]/state") != 3 and getprop("/engines/engine[1]/state") != 3) {
|
||||||
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
|
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
||||||
}
|
}
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||||
}
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
|
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].scrollLeft();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].scrollLeft();
|
||||||
}
|
}
|
||||||
} else if (btn == "right") {
|
} else if (btn == "right") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
if (getprop("MCDU[" ~ i ~ "]/page") == "DATA") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
|
setprop("MCDU[" ~ i ~ "]/page", "DATA2");
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DATA2") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
setprop("MCDU[" ~ i ~ "]/page", "DATA");
|
||||||
}
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "INITA") {
|
if (getprop("/engines/engine[0]/state") != 3 and getprop("/engines/engine[1]/state") != 3) {
|
||||||
if (getprop("engines/engine[0]/state") != 3 and getprop("engines/engine[1]/state") != 3) {
|
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
setprop("MCDU[" ~ i ~ "]/page", "INITB");
|
||||||
}
|
}
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "INITB") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
setprop("MCDU[" ~ i ~ "]/page", "INITA");
|
||||||
}
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
||||||
if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC") {
|
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
|
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC2");
|
||||||
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "PRINTFUNC2") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].scrollRight();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].scrollRight();
|
||||||
}
|
}
|
||||||
} else if (btn == "up") {
|
} else if (btn == "up") {
|
||||||
# Nothing for now
|
if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].scrollUp();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].scrollUp();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].scrollUp();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].scrollUp();
|
||||||
|
}
|
||||||
} else if (btn == "down") {
|
} else if (btn == "down") {
|
||||||
# Nothing for now
|
if (getprop("MCDU[" ~ i ~ "]/page") == "F-PLNA" or getprop("MCDU[" ~ i ~ "]/page") == "F-PLNB") {
|
||||||
|
canvas_mcdu.myFpln[i].scrollDn();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DEPARTURE") {
|
||||||
|
canvas_mcdu.myDeparture[i].scrollDn();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "ARRIVAL") {
|
||||||
|
canvas_mcdu.myArrival[i].scrollDn();
|
||||||
|
} else if (getprop("MCDU[" ~ i ~ "]/page") == "DIRTO") {
|
||||||
|
canvas_mcdu.myDirTo[i].scrollDn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,9 +551,31 @@ var pagebutton = func(btn, i) {
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "SELECT DESIRED SYSTEM");
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
|
setprop("MCDU[" ~ i ~ "]/page", "MCDU");
|
||||||
} else if (btn == "f-pln") {
|
} else if (btn == "f-pln") {
|
||||||
|
if (fmgc.flightPlanController.active.getBoolValue()) {
|
||||||
|
if (canvas_mcdu.myFpln[i] == nil) {
|
||||||
|
canvas_mcdu.myFpln[i] = fplnPage.new(2, i);
|
||||||
|
}
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
|
setprop("MCDU[" ~ i ~ "]/page", "F-PLNA");
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
|
||||||
|
}
|
||||||
} else if (btn == "fuel-pred") {
|
} else if (btn == "fuel-pred") {
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
setprop("MCDU[" ~ i ~ "]/page", "FUELPRED");
|
||||||
|
} else if (btn == "dirto") {
|
||||||
|
if (fmgc.flightPlanController.active.getBoolValue()) {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[i] and !dirToFlag) {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "INSRT / ERASE TMPY FIRST");
|
||||||
|
return;
|
||||||
|
} elsif (canvas_mcdu.myDirTo[i] == nil) {
|
||||||
|
canvas_mcdu.myDirTo[i] = dirTo.new(i);
|
||||||
|
}
|
||||||
|
setprop("MCDU[" ~ i ~ "]/page", "DIRTO");
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "ERROR. INITIALIZE ROUTE"); # Should be ERROR:, but the : character doesn't show in our MCDU font right now...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -573,6 +744,18 @@ var notAllowed = func(i) {
|
||||||
setprop("MCDU[" ~ i ~ "]/scratchpad", "NOT ALLOWED");
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "NOT ALLOWED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var formatError = func(i) {
|
||||||
|
if (getprop("MCDU[" ~ i ~ "]/scratchpad") != "FORMAT ERROR") {
|
||||||
|
if (getprop("MCDU[" ~ i ~ "]/scratchpad-msg") == 1) {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/last-scratchpad", "");
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ i ~ "]/last-scratchpad", getprop("MCDU[" ~ i ~ "]/scratchpad"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ i ~ "]/scratchpad", "FORMAT ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
var screenFlash = func(time, i) {
|
var screenFlash = func(time, i) {
|
||||||
var page = getprop("MCDU[" ~ i ~ "]/page");
|
var page = getprop("MCDU[" ~ i ~ "]/page");
|
||||||
setprop("MCDU[" ~ i ~ "]/page", "NONE");
|
setprop("MCDU[" ~ i ~ "]/page", "NONE");
|
||||||
|
|
110
Nasal/MCDU/VERTREV.nas
Normal file
110
Nasal/MCDU/VERTREV.nas
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
var vertRev = {
|
||||||
|
title: [nil, nil, nil],
|
||||||
|
subtitle: [nil, nil],
|
||||||
|
fontMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsMatrix: [[0, 0, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0]],
|
||||||
|
arrowsColour: [["ack", "ack", "ack", "ack", "ack", "ack"],["ack", "ack", "ack", "ack", "ack", "ack"]],
|
||||||
|
L1: [nil, nil, "ack"], # content, title, colour
|
||||||
|
L2: [nil, nil, "ack"],
|
||||||
|
L3: [nil, nil, "ack"],
|
||||||
|
L4: [nil, nil, "ack"],
|
||||||
|
L5: [nil, nil, "ack"],
|
||||||
|
L6: [nil, nil, "ack"],
|
||||||
|
R1: [nil, nil, "ack"],
|
||||||
|
R2: [nil, nil, "ack"],
|
||||||
|
R3: [nil, nil, "ack"],
|
||||||
|
R4: [nil, nil, "ack"],
|
||||||
|
R5: [nil, nil, "ack"],
|
||||||
|
R6: [nil, nil, "ack"],
|
||||||
|
depAirport: nil,
|
||||||
|
arrAirport: nil,
|
||||||
|
index: nil,
|
||||||
|
computer: nil,
|
||||||
|
new: func(type, id, index, computer) {
|
||||||
|
var vr = {parents:[vertRev]};
|
||||||
|
vr.type = type; # 0 = origin 1 = destination 2 = wpt not ppos 3 = ppos 4 = cruise wpt 5 = climb wpt (3 + 4 not needed yet)
|
||||||
|
vr.id = id;
|
||||||
|
vr.index = index;
|
||||||
|
vr.computer = computer;
|
||||||
|
vr._setupPageWithData();
|
||||||
|
vr._checkTmpy();
|
||||||
|
return vr;
|
||||||
|
},
|
||||||
|
del: func() {
|
||||||
|
return nil;
|
||||||
|
},
|
||||||
|
_checkTmpy: func() {
|
||||||
|
if (fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
me.L6 = [" F-PLN", " TMPY", "yel"];
|
||||||
|
me.arrowsColour[0][5] = "yel";
|
||||||
|
canvas_mcdu.pageSwitch[me.computer].setBoolValue(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_setupPageWithData: func() {
|
||||||
|
if (me.type == 3) {
|
||||||
|
me.title = ["VERT REV", " AT ", "PPOS"];
|
||||||
|
me.L1 = ["", " EFOB ---.-", "wht"];
|
||||||
|
me.R1 = ["", "EXTRA ---.- ", "wht"];
|
||||||
|
me.L2 = [" 250/10000", " CLB SPD LIM", "mag"];
|
||||||
|
me.L4 = [" CONSTANT MACH", nil, "wht"];
|
||||||
|
me.L5 = [" WIND DATA", nil, "wht"];
|
||||||
|
me.L6 = [" RETURN", nil, "wht"];
|
||||||
|
me.R5 = ["STEP ALTS ", nil, "wht"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "ack", "ack", "ack", "wht", "wht"]];
|
||||||
|
me.fontMatrix = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
|
||||||
|
} if (me.type == 2) {
|
||||||
|
me.title = ["VERT REV", " AT ", me.id];
|
||||||
|
me.L1 = ["", " EFOB ---.-", "wht"];
|
||||||
|
me.R1 = ["", "EXTRA ---.- ", "wht"];
|
||||||
|
me.L2 = [" 250/10000", " CLB SPD LIM", "mag"];
|
||||||
|
me.L3 = [" [ ]", " SPD CSTR", "blu"];
|
||||||
|
me.L4 = [" CONSTANT MACH", nil, "wht"];
|
||||||
|
me.L5 = [" WIND DATA", nil, "wht"];
|
||||||
|
me.L6 = [" CLB", nil, "wht"];
|
||||||
|
me.R2 = ["[ ] ", "UTC CSTR ", "blu"];
|
||||||
|
me.R3 = ["[ ] ", "ALT CSTR ", "blu"];
|
||||||
|
me.R5 = ["STEP ALTS ", nil, "wht"];
|
||||||
|
me.R6 = ["DES ", nil, "wht"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "ack", "ack", "ack", "wht", "wht"]];
|
||||||
|
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0]];
|
||||||
|
} else {
|
||||||
|
me.title = ["VERT REV", " AT ", me.id];
|
||||||
|
|
||||||
|
if (me.type == 0) {
|
||||||
|
# dunno
|
||||||
|
} elsif (me.type == 1) {
|
||||||
|
if (size(me.id) > 4) {
|
||||||
|
me.arrAirport = findAirportsByICAO(left(me.id, 4));
|
||||||
|
} else {
|
||||||
|
me.arrAirport = findAirportsByICAO(me.id);
|
||||||
|
}
|
||||||
|
me.L1 = ["", " EFOB ---.-", "wht"];
|
||||||
|
me.R1 = ["", "EXTRA ---.- ", "wht"];
|
||||||
|
me.L2 = [" 250/10000", " DES SPD LIM", "mag"];
|
||||||
|
me.L4 = [" CONSTANT MACH", nil, "wht"];
|
||||||
|
me.L5 = [" WIND DATA", nil, "wht"];
|
||||||
|
me.L6 = [" CLB", nil, "wht"];
|
||||||
|
me.R2 = ["[ ] ", "UTC CSTR ", "blu"];
|
||||||
|
me.R3 = ["[ ]", "G/S INTCPT ", "grn"];
|
||||||
|
me.R5 = ["STEP ALTS ", nil, "wht"];
|
||||||
|
me.R6 = ["DES ", nil, "wht"];
|
||||||
|
me.arrowsMatrix = [[0, 0, 0, 1, 1, 1], [0, 0, 0, 0, 1, 1]];
|
||||||
|
me.arrowsColour = [["ack", "ack", "ack", "wht", "wht", "wht"], ["ack", "ack", "ack", "ack", "wht", "wht"]];
|
||||||
|
me.fontMatrix = [[0, 0, 1, 0, 0, 0], [0, 1, 1, 0, 0, 0]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeTmpy: func() {
|
||||||
|
if (!fmgc.flightPlanController.temporaryFlag[me.computer]) {
|
||||||
|
if (!dirToFlag) {
|
||||||
|
fmgc.flightPlanController.createTemporaryFlightPlan(me.computer);
|
||||||
|
} else {
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad-msg", 1);
|
||||||
|
setprop("MCDU[" ~ me.computer ~ "]/scratchpad", "DIR TO IN PROGRESS");
|
||||||
|
}
|
||||||
|
me._checkTmpy();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
|
@ -205,6 +205,7 @@ var systemsInit = func {
|
||||||
systems.eng_init();
|
systems.eng_init();
|
||||||
systems.fire_init();
|
systems.fire_init();
|
||||||
systems.autobrake_init();
|
systems.autobrake_init();
|
||||||
|
fmgc.flightPlanController.reset();
|
||||||
fadec.FADEC.init();
|
fadec.FADEC.init();
|
||||||
fmgc.ITAF.init();
|
fmgc.ITAF.init();
|
||||||
fmgc.FMGCinit();
|
fmgc.FMGCinit();
|
||||||
|
@ -226,6 +227,7 @@ var systemsInit = func {
|
||||||
|
|
||||||
setlistener("/sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/fdm-initialized", func {
|
||||||
systemsInit();
|
systemsInit();
|
||||||
|
fmgc.flightPlanTimer.start();
|
||||||
});
|
});
|
||||||
|
|
||||||
var systemsLoop = maketimer(0.1, func {
|
var systemsLoop = maketimer(0.1, func {
|
||||||
|
|
|
@ -73,6 +73,9 @@ var Instrumentation = {
|
||||||
AirspeedIndicator: {
|
AirspeedIndicator: {
|
||||||
indicatedSpdKt: props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt"),
|
indicatedSpdKt: props.globals.getNode("instrumentation/airspeed-indicator/indicated-speed-kt"),
|
||||||
},
|
},
|
||||||
|
Altimeter: {
|
||||||
|
indicatedFt: props.globals.getNode("instrumentation/altimeter[0]/indicated-altitude-ft"),
|
||||||
|
},
|
||||||
TCAS: {
|
TCAS: {
|
||||||
Inputs: {
|
Inputs: {
|
||||||
mode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
|
mode: props.globals.getNode("instrumentation/tcas/inputs/mode"),
|
||||||
|
|
|
@ -1557,9 +1557,11 @@
|
||||||
<mode>once</mode>
|
<mode>once</mode>
|
||||||
<type>avionics</type>
|
<type>avionics</type>
|
||||||
<condition>
|
<condition>
|
||||||
<property>/sim/current-view/internal</property>
|
|
||||||
<property>/sim/sound/warnings/chime</property>
|
<property>/sim/sound/warnings/chime</property>
|
||||||
</condition>
|
</condition>
|
||||||
|
<volume>
|
||||||
|
<property>/sim/current-view/internal</property>
|
||||||
|
</volume>
|
||||||
<reference-dist>10</reference-dist>
|
<reference-dist>10</reference-dist>
|
||||||
<max-dist>100</max-dist>
|
<max-dist>100</max-dist>
|
||||||
</chime>
|
</chime>
|
||||||
|
|
|
@ -449,7 +449,7 @@
|
||||||
</condition>
|
</condition>
|
||||||
<expression>
|
<expression>
|
||||||
<sum>
|
<sum>
|
||||||
<property>/autopilot/route-manager/wp[0]/true-bearing-deg</property>
|
<property>/FMGC/flightplan[2]/current-leg-course</property>
|
||||||
<product>
|
<product>
|
||||||
<property>/it-autoflight/internal/drift-angle-deg</property>
|
<property>/it-autoflight/internal/drift-angle-deg</property>
|
||||||
<value>-1.0</value>
|
<value>-1.0</value>
|
||||||
|
|
|
@ -292,6 +292,16 @@
|
||||||
<legend>DIR</legend>
|
<legend>DIR</legend>
|
||||||
<pref-height>25</pref-height>
|
<pref-height>25</pref-height>
|
||||||
<pref-width>40</pref-width>
|
<pref-width>40</pref-width>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>mcdu.pagebutton("dirto", 0);</script>
|
||||||
|
<condition>
|
||||||
|
<greater-than-equals>
|
||||||
|
<property>systems/electrical/bus/ac-1</property>
|
||||||
|
<value>110</value>
|
||||||
|
</greater-than-equals>
|
||||||
|
</condition>
|
||||||
|
</binding>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button>
|
<button>
|
||||||
|
|
|
@ -292,6 +292,16 @@
|
||||||
<legend>DIR</legend>
|
<legend>DIR</legend>
|
||||||
<pref-height>25</pref-height>
|
<pref-height>25</pref-height>
|
||||||
<pref-width>40</pref-width>
|
<pref-width>40</pref-width>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>mcdu.pagebutton("dir-to", 0);</script>
|
||||||
|
<condition>
|
||||||
|
<greater-than-equals>
|
||||||
|
<property>systems/electrical/bus/ac-2</property>
|
||||||
|
<value>110</value>
|
||||||
|
</greater-than-equals>
|
||||||
|
</condition>
|
||||||
|
</binding>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button>
|
<button>
|
||||||
|
|
Loading…
Reference in a new issue