1
0
Fork 0

FG1000 - NRST PFD Function

Implement the Nearest Airports PFD softkey, displaying a scrollable
list of the closest 25 airports within 200nm.

Also fix a couple of minor bugs and add self-checking to the
GroupElement
This commit is contained in:
Stuart Buchanan 2020-03-12 21:39:23 +00:00
parent 76cfa2c077
commit 3caa899068
13 changed files with 1151 additions and 43 deletions

View file

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1024px"
height="768px"
viewBox="0 0 1024 768"
version="1.1"
id="SVGRoot"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="NearestAirportsInfoPFD.svg">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#ffffff"
borderopacity="0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.2962556"
inkscape:cx="845.07062"
inkscape:cy="175.28482"
inkscape:document-units="px"
inkscape:current-layer="NearestAirportsPFDInfo"
showgrid="true"
inkscape:window-width="1323"
inkscape:window-height="1220"
inkscape:window-x="1237"
inkscape:window-y="108"
inkscape:window-maximized="0"
inkscape:snap-global="true"
inkscape:snap-grids="true"
inkscape:snap-bbox="true"
inkscape:snap-others="true"
inkscape:snap-to-guides="true"
inkscape:bbox-paths="false"
inkscape:snap-nodes="true"
inkscape:snap-page="true"
inkscape:bbox-nodes="true">
<inkscape:grid
type="xygrid"
id="grid4269" />
</sodipodi:namedview>
<defs
id="defs7962" />
<metadata
id="metadata7965">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="DirectToGroup">
<g
id="NearestAirportsPFDInfo"
inkscape:label="#g1497"
transform="translate(-19,-51)">
<path
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="M 730,553.99805 V 743 h 295.4418 V 553.99805 Z"
id="rect4230"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="738.6875"
y="596.84375"
id="NearestAirportsPFDInfoID"
inkscape:label="#text4174"><tspan
sodipodi:role="line"
id="tspan4697"
x="738.6875"
y="596.84375">KSFO</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="1014.7031"
y="597.84375"
id="NearestAirportsPFDInfoName"
inkscape:label="#text4198"><tspan
sodipodi:role="line"
id="tspan5719"
x="1014.7031"
y="597.84375">AIRPORT NAME</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#fffcfa;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="783.98224"
y="572.34375"
id="text3449"
inkscape:transform-center-y="1.5396953"><tspan
sodipodi:role="line"
id="tspan5717"
x="783.98224"
y="572.34375">AIRPORT INFORMATION</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="738.6875"
y="617.84375"
id="NearestAirportsPFDInfoFacility"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5721"
x="738.6875"
y="617.84375">FACILITY</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 735,577 h 280"
id="path58399"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="1014.375"
y="647.84375"
id="NearestAirportsPFDInfoAlt"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan4727"
x="1014.375"
y="647.84375">10999FT</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="830.96094"
y="648"
id="NearestAirportsPFDInfoTime"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5741"
x="830.96094"
y="648">TIME</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="738.6875"
y="667.84375"
id="NearestAirportsPFDInfoRegion"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5761"
x="738.6875"
y="667.84375">REGION</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="738.6875"
y="687.84375"
id="NearestAirportsPFDInfoLat"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5781"
x="738.6875"
y="687.84375">N 38.34</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="738.6875"
y="707.84375"
id="NearestAirportsPFDInfoLon"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5781-8"
x="738.6875"
y="707.84375">N 38.34</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 735,627.5 h 280"
id="path58399-1"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="738.6875"
y="647.84375"
id="NearestAirportsPFDInfoUsage"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5721-9"
x="738.6875"
y="647.84375">FACILITY</tspan></text>
<flowRoot
xml:space="preserve"
id="flowRoot5834"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:12px;line-height:150%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion
id="flowRegion5836"><rect
id="rect5838"
width="370"
height="100"
x="705"
y="633" /></flowRegion><flowPara
id="flowPara5840" /></flowRoot> <flowRoot
xml:space="preserve"
id="flowRoot5842"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:12px;line-height:150%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"><flowRegion
id="flowRegion5844"><rect
id="rect5846"
width="55"
height="25"
x="705"
y="628" /></flowRegion><flowPara
id="flowPara5848" /></flowRoot> <text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#f9ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="964.64062"
y="713"
id="NearestAirportsPFDInfoBack"
inkscape:label="#text4166"><tspan
sodipodi:role="line"
id="tspan5868"
x="964.64062"
y="713">BACK</tspan></text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,396 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1024px"
height="768px"
viewBox="0 0 1024 768"
version="1.1"
id="SVGRoot"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="NearestAirportsPFD.svg">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#ffffff"
borderopacity="0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.2473958"
inkscape:cx="830.69507"
inkscape:cy="157.96358"
inkscape:document-units="px"
inkscape:current-layer="g1519"
showgrid="true"
inkscape:window-width="1747"
inkscape:window-height="1155"
inkscape:window-x="95"
inkscape:window-y="55"
inkscape:window-maximized="0"
inkscape:snap-global="true"
inkscape:snap-grids="true"
inkscape:snap-bbox="true"
inkscape:snap-others="true"
inkscape:snap-to-guides="true"
inkscape:bbox-paths="false"
inkscape:snap-nodes="true"
inkscape:snap-page="true"
inkscape:bbox-nodes="true">
<inkscape:grid
type="xygrid"
id="grid4269" />
</sodipodi:namedview>
<defs
id="defs7962" />
<metadata
id="metadata7965">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="DirectToGroup">
<g
id="NearestAirportsPFDGroup"
inkscape:label="#g9755"
transform="translate(-17.55824,-51.00195)">
<g
id="g1519">
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="rect4230"
d="M 728.55824,554 V 743.00195 H 1024 V 554 Z"
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<text
inkscape:label="#text4174"
id="NearestAirportsPFDID0"
y="596.84375"
x="738.6875"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="596.84375"
x="738.6875"
id="tspan4697"
sodipodi:role="line">KSFO</tspan></text>
<text
inkscape:label="#text4198"
id="NearestAirportsPFDAPP0"
y="597"
x="1003.3082"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="597"
x="1003.3082"
id="tspan4695"
sodipodi:role="line">VFR</tspan></text>
<text
id="text3449"
y="571.34375"
x="799.75"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#fffcfa;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="571.34375"
x="799.75"
id="tspan1480"
sodipodi:role="line">NEAREST AIRPORTS</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDCommsFreq0"
y="616.84375"
x="823.78125"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="616.84375"
x="823.78125"
id="tspan4703"
sodipodi:role="line">123.475</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDCommsType0"
y="616.86981"
x="739.7005"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.33333302px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="616.86981"
x="739.7005"
id="tspan4701"
sodipodi:role="line">TOWER</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="823.78125"
y="596.84375"
id="NearestAirportsPFDBRG0"
inkscape:label="#text4166"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"
sodipodi:role="line"
id="tspan3555"
x="823.78125"
y="596.84375">189</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDDST0"
y="596.84375"
x="888.78125"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="596.84375"
x="888.78125"
id="tspan4699"
sodipodi:role="line">12.3NM</tspan></text>
<text
inkscape:label="#text4166"
id="text58391"
y="617"
x="888.90625"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.33333302px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="617"
x="888.90625"
id="tspan4707"
sodipodi:role="line">RNWY</tspan></text>
<path
inkscape:connector-curvature="0"
id="path58399"
d="m 735,577 h 280"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
inkscape:label="#text4166"
id="NearestAirportsPFDRWY0"
y="616.84375"
x="1002.9332"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="616.84375"
x="1002.9332"
id="tspan4727"
sodipodi:role="line">10999FT</tspan></text>
<text
inkscape:label="#text4174"
id="NearestAirportsPFDID1"
y="646.84375"
x="738.6875"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="646.84375"
x="738.6875"
id="tspan4697-9"
sodipodi:role="line">KSFO</tspan></text>
<text
inkscape:label="#text4198"
id="NearestAirportsPFDAPP1"
y="647"
x="1003.3082"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="647"
x="1003.3082"
id="tspan4695-2"
sodipodi:role="line">VFR</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDCommsFreq1"
y="666.84375"
x="823.78125"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="666.84375"
x="823.78125"
id="tspan4703-3"
sodipodi:role="line">123.475</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDCommsType1"
y="666.86981"
x="739.7005"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.33333302px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="666.86981"
x="739.7005"
id="tspan4701-9"
sodipodi:role="line">TOWER</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="823.78125"
y="646.84375"
id="NearestAirportsPFDBRG1"
inkscape:label="#text4166"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"
sodipodi:role="line"
id="tspan3555-1"
x="823.78125"
y="646.84375">189</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDDST1"
y="646.84375"
x="888.78125"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="646.84375"
x="888.78125"
id="tspan4699-4"
sodipodi:role="line">12.3NM</tspan></text>
<text
inkscape:label="#text4166"
id="text58391-5"
y="667"
x="888.90625"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.33333302px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="667"
x="888.90625"
id="tspan4707-8"
sodipodi:role="line">RNWY</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDRWY1"
y="666.84375"
x="1002.9332"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="666.84375"
x="1002.9332"
id="tspan4727-7"
sodipodi:role="line">10999FT</tspan></text>
<path
inkscape:connector-curvature="0"
id="path58399-6"
d="m 740,627.5 h 265"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
inkscape:label="#text4174"
id="NearestAirportsPFDID2"
y="696.84375"
x="738.6875"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="696.84375"
x="738.6875"
id="tspan4697-9-2"
sodipodi:role="line">KSFO</tspan></text>
<text
inkscape:label="#text4198"
id="NearestAirportsPFDAPP2"
y="697"
x="1003.3082"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="697"
x="1003.3082"
id="tspan4695-2-1"
sodipodi:role="line">VFR</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDCommsFreq2"
y="716.84375"
x="823.78125"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="716.84375"
x="823.78125"
id="tspan4703-3-4"
sodipodi:role="line">123.475</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDCommsType2"
y="716.86981"
x="739.7005"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.33333302px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="716.86981"
x="739.7005"
id="tspan4701-9-8"
sodipodi:role="line">TOWER</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="823.78125"
y="696.84375"
id="NearestAirportsPFDBRG2"
inkscape:label="#text4166"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"
sodipodi:role="line"
id="tspan3555-1-3"
x="823.78125"
y="696.84375">189</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDDST2"
y="696.84375"
x="888.78125"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="696.84375"
x="888.78125"
id="tspan4699-4-7"
sodipodi:role="line">12.3NM</tspan></text>
<text
inkscape:label="#text4166"
id="text58391-5-2"
y="717"
x="888.90625"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:13.33333302px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="717"
x="888.90625"
id="tspan4707-8-3"
sodipodi:role="line">RNWY</tspan></text>
<text
inkscape:label="#text4166"
id="NearestAirportsPFDRWY2"
y="716.84375"
x="1002.9332"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:0%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#80ffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="716.84375"
x="1002.9332"
id="tspan4727-7-2"
sodipodi:role="line">10999FT</tspan></text>
<path
inkscape:connector-curvature="0"
id="path58399-6-5"
d="m 740,677.5 h 265"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path58399-6-5-9"
d="m 740,727.5 h 265"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<rect
style="opacity:1;fill:#c0c0c0;fill-opacity:1;fill-rule:nonzero;stroke:#c0c0c0;stroke-width:0.87119991;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="NearestAirportsPFDScrollBar"
width="4.7759156"
height="139.1288"
x="1010.4354"
y="583.43561"
inkscape:label="#rect4231" />
<rect
inkscape:label="#rect4231"
y="583.18475"
x="1010.2258"
height="24.589478"
width="5.1815677"
id="NearestAirportsPFDScroll"
style="opacity:1;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:#808080;stroke-width:0.45150775;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -109,7 +109,7 @@ getTextElement : func(symbolName) {
return me._textElements[symbolName];
},
highlightTextElement : func(symbolName, highlightime=nil) {
highlightTextElement : func(symbolName, highlightime=-1) {
me._textElements[symbolName].highlightElement(highlightime);
},

View file

@ -0,0 +1,208 @@
# Copyright 2018 Stuart Buchanan
# This file is part of FlightGear.
#
# FlightGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# FlightGear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
#
# NearestAirportsPFD
var NearestAirportsPFD =
{
new : func (mfd, myCanvas, device, svg)
{
var obj = {
parents : [
NearestAirportsPFD,
MFDPage.new(mfd, myCanvas, device, svg, "NearestAirportsPFD", "NRST - NEAREST AIRPORTS")
],
};
obj.setController(fg1000.NearestAirportsPFDController.new(obj, svg));
# Dynamic elements. There are 2 different sets of dynamic elements:
#
# Nearest Airports - this is a scrolling list of up to 25 airports within 200nm, shown 3 at a time.
# Airport Information - A page of more detailed information displaying details of the selected airport
#
# Selection is via the ENT key or the FMS knob
obj.airportSelect = PFD.GroupElement.new(
obj.pageName,
svg,
[ "ID", "BRG", "DST", "APP", "CommsType", "CommsFreq", "RWY"],
3,
"ID",
0,
"ScrollBar",
"Scroll",
140
);
# Dynamic text elements for the Airport Info pane.
obj.addTextElements(["InfoID", "InfoName",
"InfoFacility",
"InfoUsage", "InfoTime", "InfoAlt",
"InfoRegion",
"InfoLat", "InfoLon", "InfoBack"]);
obj.setTextElement("InfoBack", "BACK");
obj._visible = 0;
obj._NO_AIRPORTS = "NONE WITHIN 200NM";
obj.getElement("Group").setVisible(0);
obj.getElement("Info").setVisible(0);
return obj;
},
visible : func() {
return me._visible;
},
toggleDisplay : func() {
if (me.visible()) {
me.offdisplay();
} else {
me.ondisplay();
}
},
offdisplay : func() {
me.getElement("Group").setVisible(0);
me.getElement("Info").setVisible(0);
me._visible = 0;
me.getController().offdisplay();
},
ondisplay : func() {
me._visible = 1;
me.getController().ondisplay();
me.displayNearest();
},
displayNearest : func() {
me.getElement("Group").setVisible(1);
me.getElement("Info").setVisible(0);
},
displayInfo : func() {
me.getElement("Group").setVisible(0);
me.getElement("Info").setVisible(1);
me.highlightTextElement("InfoBack");
},
updateAirports : func(apts) {
var airportlist = [];
for (var i = 0; i < size(apts); i = i + 1) {
var apt = apts[i];
var crsAndDst = courseAndDistance(apt);
# Display the course and distance in NM .
var crs = sprintf("%i°", crsAndDst[0]);
var dst = sprintf("%.1fnm", crsAndDst[1]);
# We need to derive various non-trivial pieces of information:
# - Maximum runway Length
# - Approach type - VFR, ILS, NDB
# - Approach, Tower or Unicom frequency
var max_rwy = 0;
var app_type = "VFR";
var freq_type = "";
var freq = "";
foreach(var rwy; keys(apt.runways)) {
var rwy_info = apt.runways[rwy];
max_rwy = math.max(max_rwy, rwy_info.length);
# This is the best we can do at present for approach types.
if (rwy_info.ils_frequency_mhz != nil) app_type = "ILS";
}
var apt_comms = apt.comms();
foreach (var c; apt_comms) {
if (string.icmp(c.ident, "Approach") or
string.icmp(c.ident, "APP") or
string.icmp(c.ident, "APPROACH") ) {
freq_type = "APPROACH";
freq = sprintf("%.3f", c.frequency);
# Fine - we've got the best possible frequency, so break out
# to stop any Tower frequencies from over-writing.
break;
}
if (string.icmp(c.ident, "Tower") or
string.icmp(c.ident, "TWR") or
string.icmp(c.ident, "Tower") ) {
freq_type = "TOWER";
freq = sprintf("%.3f", c.frequency);
}
# Only select a Unicom / Traffic if there's nothing found already
if ((freq_type == "") and
(string.icmp(c.ident, "Unicom") or
string.icmp(c.ident, "UNICOM") )) {
freq_type = "UNICOM";
freq = sprintf("%.3f", c.frequency);
}
}
# Convert into something we can pass straight to the UIGroup.
append(airportlist, {
ID: apt.id,
BRG: crs,
DST: dst,
APP: app_type,
CommsType : freq_type,
CommsFreq : freq,
RWY : sprintf("%ift", 3.28 * max_rwy)
});
}
if (size(airportlist) == 0) {
# Blank value if in the middle of nowhere
append(airportlist, {
ID: me._NO_AIRPORTS,
BRG: "",
DST: "",
APP: "",
CommsType : "",
CommsFreq : "",
RWY : ""
});
}
me.airportSelect.setValues(airportlist);
},
updateAirportData : func(apt) {
if (apt == nil) return;
me.setTextElement("InfoID", apt.id);
me.setTextElement("InfoName", string.uc(apt.name));
me.setTextElement("InfoFacility", "");
if (string.imatch(apt.name, "private") or string.imatch(apt.name, "pvt")) {
me.setTextElement("InfoUsage", "PRIVATE");
} else {
me.setTextElement("InfoUsage", "PUBLIC");
}
me.setTextElement("InfoTime", "");
me.setTextElement("InfoAlt", sprintf("%ift", 3.28 * apt.elevation));
me.setTextElementLat("InfoLat", apt.lat);
me.setTextElementLon("InfoLon", apt.lon);
},
getSelectedAirportID : func() {
var id = me.airportSelect.getValue();
if (id == me._NO_AIRPORTS) id = nil;
return id;
},
};

View file

@ -0,0 +1,173 @@
# Copyright 2018 Stuart Buchanan
# This file is part of FlightGear.
#
# FlightGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# FlightGear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
#
# NearestAirportsPFD Controller
var NearestAirportsPFDController =
{
MODE : {
NONE : 0, # Nothing displayed
NEAREST : 1, # Nearest Airports pane visible
INFO : 2, # Airport Info pane visible
},
new : func (page, svg)
{
var obj = { parents : [ NearestAirportsPFDController, MFDPageController.new(page) ] };
# Current active UI group.
obj.page = page;
obj._mode = NearestAirportsPFDController.MODE.NONE;
obj._crsrToggle = 0;
return obj;
},
selectNearest : func() {
me.selectGroup(NearestAirportsPFDController.MODE.NEAREST)
},
selectInfo : func() {
me.selectGroup(NearestAirportsPFDController.MODE.INFO);
},
selectNone : func() {
me.selectGroup(NearestAirportsPFDController.MODE.NONE);
},
getSelectedMode : func() {
return me._mode;
},
selectGroup : func(grp) {
me._mode = grp;
if (grp == NearestAirportsPFDController.MODE.NONE) {
me.page.offdisplay();
}
if (grp == NearestAirportsPFDController.MODE.NEAREST) {
me.page.displayNearest();
}
if (grp == NearestAirportsPFDController.MODE.INFO) {
var aptdata = me.getAirport(me.page.getSelectedAirportID());
me.page.updateAirportData(aptdata);
me.page.displayInfo();
}
},
# Input Handling
handleCRSR : func(value) {
me._crsrToggle = (! me._crsrToggle);
if (me._crsrToggle) {
me.page.airportSelect.showCRSR();
} else {
# Hide the cursor and reset any highlighting
me.page.airportSelect.hideCRSR();
}
return emesary.Transmitter.ReceiptStatus_Finished;
},
handleFMSInner : func(value) {
if (me._crsrToggle and (me._mode == NearestAirportsPFDController.MODE.NEAREST)) {
# Scroll through the nearest airports list
me.page.airportSelect.incrSmall(value);
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
return emesary.Transmitter.ReceiptStatus_NotProcessed;
}
},
handleFMSOuter : func(value) {
return me.handleFMSInner(value);
},
handleEnter : func(value) {
if (me._mode == NearestAirportsPFDController.MODE.NEAREST) {
# Enable the cursor if it's not already enabled.
me._crsrToggle = 1;
me.page.airportSelect.showCRSR();
# Load the current airport and display it
if (me.page.getSelectedAirportID() != nil) {
me.selectInfo();
}
return emesary.Transmitter.ReceiptStatus_Finished;
} else if (me._mode == NearestAirportsPFDController.MODE.INFO) {
# Pressing Enter on the Info window hides the info window and selects the
# next airport on the list.
# Load the current airport and display it
me.selectNearest();
me.page.airportSelect.incrSmall(1);
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
return emesary.Transmitter.ReceiptStatus_NotProcessed;
}
},
handleClear : func(value) {
if (me._mode == NearestAirportsPFDController.MODE.NEAREST) {
# Finished - unload the page.
me.page.offdisplay();
return emesary.Transmitter.ReceiptStatus_Finished;
} else if (me._mode == NearestAirportsPFDController.MODE.INFO) {
# Pressing Clear on the Info window hides the info window and selects the
# next airport on the list, just like Enter
# Load the current airport and display it
me.selectNearest();
me.page.airportSelect.incrSmall(1);
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
return emesary.Transmitter.ReceiptStatus_NotProcessed;
}
},
# Reset controller if required when the page is displayed or hidden
ondisplay : func() {
me.RegisterWithEmesary();
me.getNearestAirportsPFD();
me.selectNearest();
},
offdisplay : func() {
me.DeRegisterWithEmesary();
},
getNearestAirportsPFD : func() {
var notification = notifications.PFDEventNotification.new(
"MFD",
me.getDeviceID(),
notifications.PFDEventNotification.NavData,
{Id: "NearestAirports", Value: nil});
var response = me._transmitter.NotifyAll(notification);
if (! me._transmitter.IsFailed(response)) {
me.page.updateAirports(notification.EventParameter.Value);
} else {
return nil;
}
},
getAirport : func(id) {
# Use Emesary to get the airport
var notification = notifications.PFDEventNotification.new(
"MFD",
me.getDeviceID(),
notifications.PFDEventNotification.NavData,
{Id: "AirportByID", Value: id});
var response = me._transmitter.NotifyAll(notification);
if (! me._transmitter.IsFailed(response)) {
var apt_list = notification.EventParameter.Value;
if ((apt_list != nil) and (size(apt_list) > 0)) {
return apt_list[0];
} else {
return nil;
}
} else {
return nil;
}
},
};

View file

@ -0,0 +1,44 @@
# Copyright 2018 Stuart Buchanan
# This file is part of FlightGear.
#
# FlightGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# FlightGear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
#
# NearestAirportsPFD Options
var NearestAirportsPFDOptions =
{
new : func() {
var obj = { parents : [NearestAirportsPFDOptions] };
obj.Options= {};
obj.loadOptions();
return obj;
},
getOption : func(type) {
return me.Options[type];
},
setOption : func(type, name, value) {
me.Options[type][name] = value;
},
loadOptions : func() {
me.clearOptions();
me.Options.APS = {};
},
clearOptions : func() {
me.Options = {};
},
};

View file

@ -0,0 +1,44 @@
# Copyright 2018 Stuart Buchanan
# This file is part of FlightGear.
#
# FlightGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# FlightGear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
#
# NearestAirportsPFD Styles
var NearestAirportsPFDStyles =
{
new : func() {
var obj = { parents : [ NearestAirportsPFDStyles ]};
obj.Styles = {};
obj.loadStyles();
return obj;
},
getStyle : func(type) {
return me.Styles[type];
},
setStyle : func(type, name, value) {
me.Styles[type][name] = value;
},
loadStyles : func() {
me. clearStyles();
me.Styles.XXX = {};
},
clearStyles : func() {
me.Styles = {};
},
};

View file

@ -131,11 +131,29 @@ var PFDInstruments =
pg.addMenuItem(7, "XPDR", pg, pg.mfd.PFDInstruments.transponderMenu);
pg.addMenuItem(8, "IDENT", pg, pg.mfd.PFDInstruments.setIdent); # TODO
pg.addMenuItem(9, "TMR/REF", pg); # TODO
pg.addMenuItem(10, "NRST", pg); # TODO
pg.addMenuItem(10, "NRST", pg, pg.mfd.PFDInstruments.toggleNRST, func(svg, mi) { pg.mfd.PFDInstruments.toggleNRSTDisplay(device, pg, svg, mi); } );
pg.addMenuItem(11, "ALERTS", pg); # TODO
device.updateMenus();
},
toggleNRST : func (device, pg, mi) {
pg.mfd.NearestAirports.toggleDisplay();
device.updateMenus();
},
toggleNRSTDisplay : func(device, pg, svg, mi) {
var bg_name = sprintf("SoftKey%d-bg",mi.menu_id);
if (pg.mfd.NearestAirports.visible()) {
device.svg.getElementById(bg_name).setColorFill(0.5,0.5,0.5);
svg.setColor(0.0,0.0,0.0);
} else {
device.svg.getElementById(bg_name).setColorFill(0.0,0.0,0.0);
svg.setColor(1.0,1.0,1.0);
}
svg.setText(mi.title);
svg.setVisible(1); # display function
},
insetMenu : func(device, pg, menuitem) {
# Switch on the inset Map
pg.setInsetMapVisible(1);

View file

@ -126,39 +126,6 @@ var PFDInstrumentsController =
},
# Input Handling
handleCRSR : func() {
me._crsrToggle = (! me._crsrToggle);
if (me._crsrToggle) {
} else {
#me.page.hideCRSR();
}
return emesary.Transmitter.ReceiptStatus_Finished;
},
handleFMSInner : func(value) {
if (me._crsrToggle == 1) {
# Scroll through whatever is the current list
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
# Pass to the page group controller to display and scroll through the page group menu
#return me.page.mfd.SurroundController.handleFMSInner(value);
}
},
handleFMSOuter : func(value) {
if (me._crsrToggle == 1) {
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
# Pass to the page group controller to display and scroll through the page group menu
#return me.page.mfd.SurroundController.handleFMSOuter(value);
}
},
handleEnter : func(value) {
if (me._crsrToggle == 1) {
return emesary.Transmitter.ReceiptStatus_Finished;
} else {
return emesary.Transmitter.ReceiptStatus_NotProcessed;
}
},
handleRange : func(val)
{
if (val >0) {

View file

@ -179,7 +179,7 @@ var Surround =
obj.hideMenu();
obj.setController(fg1000.SurroundController.new(obj, svg));
obj.setController(fg1000.SurroundController.new(obj, svg, pfd));
return obj;
},
@ -425,6 +425,9 @@ var Surround =
# Function to change a page based on the selection
loadPage : func()
{
# Not valid for the PFD.
if (me.pfd) return;
var pageToLoad = PAGE_GROUPS[me._selectedPageGroup].pages[me._selectedPage];
var page = me.getMFD().getPage(pageToLoad);
@ -442,6 +445,9 @@ var Surround =
},
showMenu : func()
{
# Not valid for the PFD.
if (me.pfd) return;
foreach(var pageGroup; PAGE_GROUPS)
{
if (PAGE_GROUPS[me._selectedPageGroup].label == pageGroup.label)

View file

@ -17,12 +17,13 @@
# Surround Controller
var SurroundController =
{
new : func (page, svg)
new : func (page, svg, pfd)
{
var obj = {
parents : [ SurroundController ],
_recipient : nil,
_page : page,
_pfd : pfd,
_comselected : 1,
_navselected : 1,
_com1active : 0.0,
@ -458,6 +459,7 @@ var SurroundController =
#
handleFMSOuter : func(val)
{
if (me._pfd) return emesary.Transmitter.ReceiptStatus_NotProcessed;
if (me._page.isMenuVisible()) {
# Change page group
me._page.incrPageGroup(val);
@ -468,6 +470,7 @@ var SurroundController =
handleFMSInner : func(val)
{
if (me._pfd) return emesary.Transmitter.ReceiptStatus_NotProcessed;
if (me._page.isMenuVisible()) {
# Change page group
me._page.incrPage(val);

View file

@ -25,6 +25,7 @@ var PFDDisplay =
EIS : nil,
PFDInstruments : nil,
Surround : nil,
NearestAirports : nil,
_pageList : {},
_fg1000 : fg1000instance,
_canvas : myCanvas,
@ -39,6 +40,11 @@ var PFDDisplay =
io.load_nasal(nasal_dir ~ "MFDPages/DirectTo/DirectTo.nas", "fg1000");
io.load_nasal(nasal_dir ~ "MFDPages/DirectTo/DirectToController.nas", "fg1000");
io.load_nasal(nasal_dir ~ "MFDPages/NearestAirportsPFD/NearestAirportsPFD.nas", "fg1000");
io.load_nasal(nasal_dir ~ "MFDPages/NearestAirportsPFD/NearestAirportsPFDStyles.nas", "fg1000");
io.load_nasal(nasal_dir ~ "MFDPages/NearestAirportsPFD/NearestAirportsPFDOptions.nas", "fg1000");
io.load_nasal(nasal_dir ~ "MFDPages/NearestAirportsPFD/NearestAirportsPFDController.nas", "fg1000");
obj.ConfigStore = obj._fg1000.getConfigStore();
obj._svg = myCanvas.createGroup("softkeys");
@ -70,6 +76,13 @@ var PFDDisplay =
'/Aircraft/Instruments-3d/FG1000/MFDPages/DirectToPFD.svg',
{'font-mapper': fontmapper});
canvas.parsesvg(obj._svg,
'/Aircraft/Instruments-3d/FG1000/MFDPages/NearestAirportsPFD.svg',
{'font-mapper': fontmapper});
canvas.parsesvg(obj._svg,
'/Aircraft/Instruments-3d/FG1000/MFDPages/NearestAirportsInfoPFD.svg',
{'font-mapper': fontmapper});
canvas.parsesvg(obj._svg,
'/Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg',
@ -84,6 +97,8 @@ var PFDDisplay =
obj._DTO = fg1000.DirectTo.new(obj, myCanvas, obj._MFDDevice, obj._svg);
obj._DTO.getController().RegisterWithEmesary();
obj.NearestAirports = fg1000.NearestAirportsPFD.new(obj, myCanvas, obj._MFDDevice, obj._svg);
obj._MFDDevice.RegisterWithEmesary();
# Surround dynamic elements
@ -94,11 +109,6 @@ var PFDDisplay =
obj.Surround = fg1000.Surround.new(obj, myCanvas, obj._MFDDevice, obj._svg, 1);
obj.SurroundController = obj.Surround.getController();
# Engine Information System. A special case as it's always displayed on the MFD.
# Note that it is passed in on the constructor
obj.EIS = EIS_Class.new(obj, myCanvas, obj._MFDDevice, obj._svg);
obj.addPage("EIS", obj.EIS);
obj.PFDInstruments = fg1000.PFDInstruments.new(obj, myCanvas, obj._MFDDevice, obj._svg);
obj.addPage("PFDInstruments", obj.PFDInstruments);
obj.PFDInstruments.topMenu(obj._MFDDevice, obj.PFDInstruments, nil);

View file

@ -17,7 +17,7 @@ new : func (pageName, svg, elementNames, displaysize, highlightElement, arrow=0,
_elementNames : elementNames,
# The size of the group. For each of the ._elementNames hash values there
# must be an SVG Element [pageName][elementName]{0...pageSize}
# must be an SVG Element [pageName][elementName]{0...(displaysize-1)}
_size : displaysize,
# ElementName to be highlighted. Must be an hash value from ._elementNames
@ -54,6 +54,14 @@ new : func (pageName, svg, elementNames, displaysize, highlightElement, arrow=0,
((scrollTroughElement != nil) and (scrollThumbElement != nil)),
"Both the scroll trough element and the scroll thumb element must be defined, or neither");
# Verify that all values exist.
for (var i = 0; i < displaysize; i = i + 1) {
foreach (var element; elementNames) {
var elementName = obj._pageName ~ element ~ i;
assert(obj._svg.getElementById(elementName) != nil, "Unable to find element " ~ elementName);
}
}
if (scrollTroughElement != nil) {
obj._scrollTroughElement = svg.getElementById(pageName ~ scrollTroughElement);
assert(obj._scrollTroughElement != nil, "Unable to find scroll element " ~ pageName ~ scrollTroughElement);