PFD UI Elements and NearestAirports page
|
@ -23,9 +23,9 @@
|
|||
borderopacity="0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.9999999"
|
||||
inkscape:cx="707.7778"
|
||||
inkscape:cy="620.40408"
|
||||
inkscape:zoom="1.6236979"
|
||||
inkscape:cx="512"
|
||||
inkscape:cy="384"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="AirportInfoGroup"
|
||||
showgrid="true"
|
||||
|
@ -534,7 +534,7 @@
|
|||
<path
|
||||
style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#404040;stroke-width:0.88437384px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 734.55781,356.83804 0,9.08226 -4.41338,-4.48437 z"
|
||||
id="RwySelectLeft"
|
||||
id="AirportInfoRunwayLeft"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:label="#path4222" />
|
||||
|
@ -542,7 +542,7 @@
|
|||
inkscape:label="#path4222"
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="RwySelectorRight"
|
||||
id="AirportInfoRunwayRight"
|
||||
d="m 799.96999,356.83804 0,9.08226 4.41338,-4.48437 z"
|
||||
style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#404040;stroke-width:0.88437384px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<rect
|
||||
|
@ -565,6 +565,54 @@
|
|||
id="tspan4231"
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';text-align:end;text-anchor:end;">2nm</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4166"
|
||||
sodipodi:linespacing="125%"
|
||||
id="AirportInfoID0"
|
||||
y="111.96484"
|
||||
x="711.10352"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="111.96484"
|
||||
x="711.10352"
|
||||
id="tspan4227"
|
||||
sodipodi:role="line">K</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="722.25781"
|
||||
y="111.96484"
|
||||
id="AirportInfoID1"
|
||||
sodipodi:linespacing="125%"
|
||||
inkscape:label="#text4166"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4232"
|
||||
x="722.25781"
|
||||
y="111.96484">S</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4166"
|
||||
sodipodi:linespacing="125%"
|
||||
id="AirportInfoID2"
|
||||
y="112.08984"
|
||||
x="732.99805"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="112.08984"
|
||||
x="732.99805"
|
||||
id="tspan4236"
|
||||
sodipodi:role="line">F</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="743.24805"
|
||||
y="111.96484"
|
||||
id="AirportInfoID3"
|
||||
sodipodi:linespacing="125%"
|
||||
inkscape:label="#text4166"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4240"
|
||||
x="743.24805"
|
||||
y="111.96484">O</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 35 KiB |
|
@ -23,9 +23,9 @@
|
|||
borderopacity="0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.70710678"
|
||||
inkscape:cx="558.90157"
|
||||
inkscape:cy="71.595861"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="713.25502"
|
||||
inkscape:cy="157.72368"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
showgrid="true"
|
||||
|
@ -952,7 +952,8 @@
|
|||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="PageGroup"
|
||||
style="display:inline">
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true">
|
||||
<g
|
||||
style="display:inline"
|
||||
id="NrstPageGroup"
|
||||
|
@ -1324,7 +1325,7 @@
|
|||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NavMap"
|
||||
id="NavigationMap"
|
||||
y="653.33002"
|
||||
x="774.98926"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:15px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
|
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
@ -1,102 +0,0 @@
|
|||
<?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.91 r13725"
|
||||
sodipodi:docname="NavigationMap.svg">
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="1071.5"
|
||||
inkscape:cy="370.94504"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer3"
|
||||
showgrid="true"
|
||||
inkscape:window-width="2495"
|
||||
inkscape:window-height="1416"
|
||||
inkscape:window-x="65"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
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="NavigationMapGroup"
|
||||
style="display:inline"
|
||||
sodipodi:insensitive="true">
|
||||
<g
|
||||
style="display:inline"
|
||||
id="NavigationMapGroup"
|
||||
inkscape:label="#g6968">
|
||||
<rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00795722;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect8420"
|
||||
width="66.992043"
|
||||
height="24.992043"
|
||||
x="957.50397"
|
||||
y="718.50403" />
|
||||
<path
|
||||
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#b6bcbe;stroke-width:0.88936359px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 958.01562,743.02999 0,-24.54969 65.91218,0"
|
||||
id="path5127-6"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:12.03934765px;line-height:0%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;fill:#31ffff;fill-opacity:1;stroke:none"
|
||||
x="1059.5933"
|
||||
y="689.10815"
|
||||
id="RangeDisplay"
|
||||
transform="scale(0.93580798,1.0685953)"
|
||||
inkscape:label="RangeDisplay"
|
||||
sodipodi:linespacing="0%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5131-3-5"
|
||||
x="1059.5933"
|
||||
y="689.10815"
|
||||
style="font-size:17.55738258px;line-height:1.25;fill:#31ffff;fill-opacity:1">Zoom nm</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 3.5 KiB |
170
Aircraft/Instruments-3d/FG1000/Models/NavigationMap.svg
Normal file
|
@ -0,0 +1,170 @@
|
|||
<?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.91 r13725"
|
||||
sodipodi:docname="NavigationMap.svg">
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="1043.4675"
|
||||
inkscape:cy="319.89557"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer3"
|
||||
showgrid="true"
|
||||
inkscape:window-width="2495"
|
||||
inkscape:window-height="1416"
|
||||
inkscape:window-x="65"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
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="NavigationMapGroup"
|
||||
style="display:inline">
|
||||
<g
|
||||
id="NavigationMapGroupFull"
|
||||
inkscape:label="#g4869">
|
||||
<rect
|
||||
y="718.50403"
|
||||
x="957.50397"
|
||||
height="24.992043"
|
||||
width="66.992043"
|
||||
id="rect8420"
|
||||
style="display:inline;opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00795722;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5127-6"
|
||||
d="m 958.01562,743.02999 0,-24.54969 65.91218,0"
|
||||
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#b6bcbe;stroke-width:0.88936359px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="0%"
|
||||
inkscape:label="RangeDisplay"
|
||||
transform="scale(0.93580798,1.0685953)"
|
||||
id="NavigationMapRangeDisplay"
|
||||
y="689.10815"
|
||||
x="1059.5933"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:12.03934765px;line-height:0%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;fill:#31ffff;fill-opacity:1;stroke:none"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-size:17.55738258px;line-height:1.25;fill:#31ffff;fill-opacity:1"
|
||||
y="689.10815"
|
||||
x="1059.5933"
|
||||
id="tspan5131-3-5"
|
||||
sodipodi:role="line">Zoom nm</tspan></text>
|
||||
<rect
|
||||
style="display:inline;opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:0.96484423;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4216"
|
||||
width="74.343285"
|
||||
height="20.035156"
|
||||
x="952.10205"
|
||||
y="63.956055" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ffffff;fill-opacity:1;stroke:#fffcfa;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="956.10889"
|
||||
y="78.973633"
|
||||
id="NavigationMapOrientation"
|
||||
sodipodi:linespacing="125%"
|
||||
inkscape:label="#text4218"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed'"
|
||||
sodipodi:role="line"
|
||||
id="tspan4220"
|
||||
x="956.10889"
|
||||
y="78.973633">NORTH UP</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="NavigationMapGroupPartial"
|
||||
inkscape:label="#g4878">
|
||||
<rect
|
||||
y="718.50403"
|
||||
x="640.57623"
|
||||
height="24.992043"
|
||||
width="66.992043"
|
||||
id="rect4809"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00795722;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4811"
|
||||
d="m 641.08786,743.02999 0,-24.54969 65.91218,0"
|
||||
style="display:inline;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#b6bcbe;stroke-width:0.88936359px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="0%"
|
||||
inkscape:label="RangeDisplay"
|
||||
transform="scale(0.93580798,1.0685953)"
|
||||
id="NavigationMapRangeDisplayPartial"
|
||||
y="689.10815"
|
||||
x="720.92578"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:12.03934765px;line-height:0%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;fill:#31ffff;fill-opacity:1;stroke:none"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-size:17.55738258px;line-height:1.25;fill:#31ffff;fill-opacity:1"
|
||||
y="689.10815"
|
||||
x="720.92578"
|
||||
id="tspan4815"
|
||||
sodipodi:role="line">Zoom nm</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:0.96484423;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4817"
|
||||
width="74.343285"
|
||||
height="20.035156"
|
||||
x="635.17432"
|
||||
y="63.956055" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#fffcfa;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="639.18115"
|
||||
y="78.973633"
|
||||
id="NavigationMapOrientationPartial"
|
||||
sodipodi:linespacing="125%"
|
||||
inkscape:label="#text4218"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed'"
|
||||
sodipodi:role="line"
|
||||
id="tspan4821"
|
||||
x="639.18115"
|
||||
y="78.973633">NORTH UP</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 7.6 KiB |
616
Aircraft/Instruments-3d/FG1000/Models/NearestAirports.svg
Normal file
|
@ -0,0 +1,616 @@
|
|||
<?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.91 r13725"
|
||||
sodipodi:docname="NearestAirports.svg">
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.2863052"
|
||||
inkscape:cx="796.08532"
|
||||
inkscape:cy="344.63751"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="NearestAirportsGroup"
|
||||
showgrid="true"
|
||||
inkscape:window-width="2495"
|
||||
inkscape:window-height="1416"
|
||||
inkscape:window-x="65"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
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"
|
||||
showguides="false">
|
||||
<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="NearestAirportsLayer">
|
||||
<g
|
||||
inkscape:label="#g4237"
|
||||
id="NearestAirportsGroup">
|
||||
<rect
|
||||
inkscape:label="#rect8921"
|
||||
y="58.493786"
|
||||
x="705.49377"
|
||||
height="684.51239"
|
||||
width="319.51242"
|
||||
id="Background"
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.987571;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<rect
|
||||
y="78.004555"
|
||||
x="710.41968"
|
||||
height="134.48459"
|
||||
width="309.66068"
|
||||
id="rect9743"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00844526;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.72408265;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect9745"
|
||||
width="309.94263"
|
||||
height="69.270592"
|
||||
x="711.26178"
|
||||
y="336.62552" />
|
||||
<rect
|
||||
y="421.24216"
|
||||
x="711.34943"
|
||||
height="107.3051"
|
||||
width="309.76727"
|
||||
id="rect9747"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.90095061;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<rect
|
||||
y="68.142975"
|
||||
x="720.14301"
|
||||
height="19.714043"
|
||||
width="134.21402"
|
||||
id="rect9753"
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1.28595793;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="text9749"
|
||||
y="83"
|
||||
x="725"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#fffcfa;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
y="83"
|
||||
x="725"
|
||||
id="tspan9751"
|
||||
sodipodi:role="line"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed'">NEAREST AIRPORTS</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:0.96605152;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4150"
|
||||
width="74.533928"
|
||||
height="20.033949"
|
||||
x="720.98303"
|
||||
y="325.59775" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:15px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="726"
|
||||
y="340.61472"
|
||||
id="text4152"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4154"
|
||||
x="726"
|
||||
y="340.61472">RUNWAYS</tspan></text>
|
||||
<rect
|
||||
y="411.81696"
|
||||
x="721.05579"
|
||||
height="19.888502"
|
||||
width="99.388496"
|
||||
id="rect4156"
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1.11149907;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="text4158"
|
||||
y="426.7612"
|
||||
x="726"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:15px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="426.7612"
|
||||
x="726"
|
||||
sodipodi:role="line"
|
||||
id="tspan4162">FREQUENCIES</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="770.69727"
|
||||
y="371.42072"
|
||||
id="NearestAirportsRunwayID"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4238"
|
||||
x="770.69727"
|
||||
y="371.42072">17-35</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsID0"
|
||||
y="106.96484"
|
||||
x="746.10352"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="106.96484"
|
||||
x="746.10352"
|
||||
id="tspan4242"
|
||||
sodipodi:role="line">KSFO</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="1009.6523"
|
||||
y="370.22604"
|
||||
id="NearestAirportsRunwaySurface"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4246"
|
||||
x="1009.6523"
|
||||
y="370.22604">HARD SURFACE</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsRunwayDimensions"
|
||||
y="395.22604"
|
||||
x="729.65234"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="395.22604"
|
||||
x="729.65234"
|
||||
id="tspan4250"
|
||||
sodipodi:role="line">PCL FREQUENCY - 122.90</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsFreqLabel0"
|
||||
y="460.59219"
|
||||
x="724.98047"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="460.59219"
|
||||
x="724.98047"
|
||||
id="tspan4254"
|
||||
sodipodi:role="line">TOWER</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="999.7793"
|
||||
y="460.59219"
|
||||
id="NearestAirportsFreq0"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4258"
|
||||
x="999.7793"
|
||||
y="460.59219">119.875</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="724.98047"
|
||||
y="484.8779"
|
||||
id="NearestAirportsFreqLabel1"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4262"
|
||||
x="724.98047"
|
||||
y="484.8779">TOWER</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsFreq1"
|
||||
y="484.8779"
|
||||
x="999.7793"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="484.8779"
|
||||
x="999.7793"
|
||||
id="tspan4266"
|
||||
sodipodi:role="line">119.875</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsFreqLabel2"
|
||||
y="509.16367"
|
||||
x="724.98047"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="509.16367"
|
||||
x="724.98047"
|
||||
id="tspan4270"
|
||||
sodipodi:role="line">TOWER</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="999.7793"
|
||||
y="509.16367"
|
||||
id="NearestAirportsFreq2"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4274"
|
||||
x="999.7793"
|
||||
y="509.16367">119.875</tspan></text>
|
||||
<path
|
||||
style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#404040;stroke-width:0.88437384px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 735.55778,360.09923 0,9.08226 -4.41338,-4.48437 z"
|
||||
id="NearestAirportsRunwayIDLeft"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:label="#path4222" />
|
||||
<path
|
||||
inkscape:label="#path4222"
|
||||
sodipodi:nodetypes="cccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="NearestAirportsRunwayIDRight"
|
||||
d="m 805.96996,360.09923 0,9.08226 4.41338,-4.48437 z"
|
||||
style="fill:#404040;fill-opacity:1;fill-rule:evenodd;stroke:#404040;stroke-width:0.88437384px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="863.65973"
|
||||
y="106.96484"
|
||||
id="NearestAirportsCRS0"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4253"
|
||||
x="863.65973"
|
||||
y="106.96484">359</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsDST0"
|
||||
y="107.79551"
|
||||
x="996.14514"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20.94000101px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr;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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="107.79551"
|
||||
x="996.14514"
|
||||
id="tspan4257"
|
||||
sodipodi:role="line">200nm</tspan></text>
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.90505791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 717.38253,98.051495 0,4.061885 10.08314,0 0,4.06188 9.26683,-6.06161 -9.26683,-6.124022 0,4.061867 z"
|
||||
id="NearestAirportsArrow0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:label="#path4259" />
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="746.10352"
|
||||
y="130.9248"
|
||||
id="NearestAirportsID1"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4263"
|
||||
x="746.10352"
|
||||
y="130.9248">KSFO</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsCRS1"
|
||||
y="130.9248"
|
||||
x="863.65973"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="130.9248"
|
||||
x="863.65973"
|
||||
id="tspan4267"
|
||||
sodipodi:role="line">359</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20.94000053px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';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="996.14514"
|
||||
y="131.24841"
|
||||
id="NearestAirportsDST1"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4271"
|
||||
x="996.14514"
|
||||
y="131.24841">200nm</tspan></text>
|
||||
<path
|
||||
inkscape:label="#path4259"
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="NearestAirportsArrow1"
|
||||
d="m 717.38253,122.01146 0,4.06188 10.08314,0 0,4.06188 9.26683,-6.06161 -9.26683,-6.12402 0,4.06187 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.90505791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsID2"
|
||||
y="154.88477"
|
||||
x="746.10352"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="154.88477"
|
||||
x="746.10352"
|
||||
id="tspan4277"
|
||||
sodipodi:role="line">KSFO</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="863.65973"
|
||||
y="154.88477"
|
||||
id="NearestAirportsCRS2"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4281"
|
||||
x="863.65973"
|
||||
y="154.88477">359</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsDST2"
|
||||
y="155.20837"
|
||||
x="996.14514"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20.94000053px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="155.20837"
|
||||
x="996.14514"
|
||||
id="tspan4285"
|
||||
sodipodi:role="line">200nm</tspan></text>
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.90505791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 717.38253,145.97142 0,4.06188 10.08314,0 0,4.06188 9.26683,-6.06161 -9.26683,-6.12402 0,4.06187 z"
|
||||
id="NearestAirportsArrow2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:label="#path4259" />
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="746.10352"
|
||||
y="178.84473"
|
||||
id="NearestAirportsID3"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4291"
|
||||
x="746.10352"
|
||||
y="178.84473">KSFO</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsCRS3"
|
||||
y="178.84473"
|
||||
x="863.65973"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="178.84473"
|
||||
x="863.65973"
|
||||
id="tspan4295"
|
||||
sodipodi:role="line">359</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20.94000053px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';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="996.14514"
|
||||
y="177.62126"
|
||||
id="NearestAirportsDST3"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4299"
|
||||
x="996.14514"
|
||||
y="177.62126">200nm</tspan></text>
|
||||
<path
|
||||
inkscape:label="#path4259"
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="NearestAirportsArrow3"
|
||||
d="m 717.38253,169.93138 0,4.06188 10.08314,0 0,4.06188 9.26683,-6.06161 -9.26683,-6.12402 0,4.06187 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.90505791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsID4"
|
||||
y="202.80469"
|
||||
x="746.10352"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="202.80469"
|
||||
x="746.10352"
|
||||
id="tspan4319"
|
||||
sodipodi:role="line">KSFO</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="863.65973"
|
||||
y="202.80469"
|
||||
id="NearestAirportsCRS4"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4323"
|
||||
x="863.65973"
|
||||
y="202.80469">359</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsDST4"
|
||||
y="203.1283"
|
||||
x="996.14514"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20.94000053px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow, Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="203.1283"
|
||||
x="996.14514"
|
||||
id="tspan4327"
|
||||
sodipodi:role="line">200nm</tspan></text>
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.90505791px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 717.38253,193.89134 0,4.06188 10.08314,0 0,4.06188 9.26683,-6.06161 -9.26683,-6.12402 0,4.06187 z"
|
||||
id="NearestAirportsArrow4"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:label="#path4259" />
|
||||
<rect
|
||||
y="234.54692"
|
||||
x="710.80701"
|
||||
height="84.196045"
|
||||
width="309.86914"
|
||||
id="rect4331"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.79819334;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<rect
|
||||
y="223.54343"
|
||||
x="720.54346"
|
||||
height="19.913141"
|
||||
width="94.913132"
|
||||
id="rect4333"
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1.08685863;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="text4335"
|
||||
y="238.49998"
|
||||
x="725.5"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:15px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="238.49998"
|
||||
x="725.5"
|
||||
id="tspan4337"
|
||||
sodipodi:role="line">INFORMATION</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;line-height:125%;font-family:Sans;-inkscape-font-specification:Sans;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"
|
||||
x="715"
|
||||
y="258"
|
||||
id="text4355"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4357"
|
||||
x="715"
|
||||
y="258" /></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsName"
|
||||
y="263.95117"
|
||||
x="719.25781"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="263.95117"
|
||||
x="719.25781"
|
||||
id="tspan4361"
|
||||
sodipodi:role="line">SAN FRANCISCO INTERNATIONAL</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsAlt"
|
||||
y="313.61914"
|
||||
x="1016.127"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="313.61914"
|
||||
x="1016.127"
|
||||
id="tspan4375"
|
||||
sodipodi:role="line">123ft</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.88014376;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4377"
|
||||
width="309.78793"
|
||||
height="102.39922"
|
||||
x="711.33911"
|
||||
y="545.15997" />
|
||||
<rect
|
||||
style="opacity:1;fill:#1a3030;fill-opacity:1;fill-rule:nonzero;stroke:#fffcfa;stroke-width:1.11149907;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect4379"
|
||||
width="99.388496"
|
||||
height="19.888502"
|
||||
x="721.05579"
|
||||
y="535.74377" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:15px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="726"
|
||||
y="550.68799"
|
||||
id="text4381"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
id="tspan4383"
|
||||
sodipodi:role="line"
|
||||
x="726"
|
||||
y="550.68799">APPROACHES</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="724.98047"
|
||||
y="584.51898"
|
||||
id="NearestAirportsApproach0"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4387"
|
||||
x="724.98047"
|
||||
y="584.51898">TOWER</tspan></text>
|
||||
<text
|
||||
sodipodi:linespacing="125%"
|
||||
id="NearestAirportsApproach1"
|
||||
y="608.80469"
|
||||
x="724.98047"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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"
|
||||
inkscape:label="#text4232"><tspan
|
||||
y="608.80469"
|
||||
x="724.98047"
|
||||
id="tspan4395"
|
||||
sodipodi:role="line">TOWER</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text4232"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:20px;line-height:125%;font-family:'Liberation Sans Narrow';-inkscape-font-specification:'Liberation Sans Narrow Condensed';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="724.98047"
|
||||
y="633.09045"
|
||||
id="NearestAirportsApproach2"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4403"
|
||||
x="724.98047"
|
||||
y="633.09045">TOWER</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 35 KiB |
|
@ -4,28 +4,12 @@ var ActiveFlightPlanNarrow =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "FPL - ACTIVE FLIGHT PLAN",
|
||||
_group : myCanvas.createGroup("ActiveFlightPlanNarrowLayer"),
|
||||
parents : [ NavMap, device.addPage("ActiveFlightPlanNarrow", "ActiveFlightPlanNarrowGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
ActiveFlightPlanNarrow,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "ActiveFlightPlanNarrow", "FPL - ACTIVE FLIGHT PLAN")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.ActiveFlightPlanNarrowStyles.new();
|
||||
obj.Options = fg1000.ActiveFlightPlanNarrowOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.ActiveFlightPlanNarrowController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var ActiveFlightPlanNarrow =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.ActiveFlightPlanNarrowController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var ActiveFlightPlanNarrow =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var ActiveFlightPlanNarrowController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ ActiveFlightPlanNarrowController ] };
|
||||
var obj = {
|
||||
parents : [ ActiveFlightPlanNarrowController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var ActiveFlightPlanWide =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "FPL - ACTIVE FLIGHT PLAN",
|
||||
_group : myCanvas.createGroup("ActiveFlightPlanWideLayer"),
|
||||
parents : [ NavMap, device.addPage("ActiveFlightPlanWide", "ActiveFlightPlanWideGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
ActiveFlightPlanWide,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "ActiveFlightPlanWide", "FPL - ACTIVE FLIGHT PLAN")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.ActiveFlightPlanWideStyles.new();
|
||||
obj.Options = fg1000.ActiveFlightPlanWideOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.ActiveFlightPlanWideController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var ActiveFlightPlanWide =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.ActiveFlightPlanWideController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var ActiveFlightPlanWide =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var ActiveFlightPlanWideController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ ActiveFlightPlanWideController ] };
|
||||
var obj = {
|
||||
parents : [ ActiveFlightPlanWideController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var AirportApproach =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - AIRPORT APPROACH INFORMATION",
|
||||
_group : myCanvas.createGroup("AirportApproachLayer"),
|
||||
parents : [ NavMap, device.addPage("AirportApproach", "AirportApproachGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
AirportApproach,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "AirportApproach", "WPT - AIRPORT APPROACH INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.AirportApproachStyles.new();
|
||||
obj.Options = fg1000.AirportApproachOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.AirportApproachController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var AirportApproach =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.AirportApproachController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var AirportApproach =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var AirportApproachController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ AirportApproachController ] };
|
||||
var obj = {
|
||||
parents : [ AirportApproachController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var AirportArrival =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - AIRPORT ARRIVAL INFORMATION",
|
||||
_group : myCanvas.createGroup("AirportArrivalLayer"),
|
||||
parents : [ NavMap, device.addPage("AirportArrival", "AirportArrivalGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
AirportArrival,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "AirportArrival", "WPT - AIRPORT ARRIVAL INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.AirportArrivalStyles.new();
|
||||
obj.Options = fg1000.AirportArrivalOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.AirportArrivalController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var AirportArrival =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.AirportArrivalController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var AirportArrival =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var AirportArrivalController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ AirportArrivalController ] };
|
||||
var obj = {
|
||||
parents : [ AirportArrivalController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var AirportDeparture =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - AIRPORT DEPARTURE INFORMATION",
|
||||
_group : myCanvas.createGroup("AirportDepartureLayer"),
|
||||
parents : [ NavMap, device.addPage("AirportDeparture", "AirportDepartureGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
AirportDeparture,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "AirportDeparture", "WPT - AIRPORT DEPARTURE INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.AirportDepartureStyles.new();
|
||||
obj.Options = fg1000.AirportDepartureOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.AirportDepartureController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var AirportDeparture =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.AirportDepartureController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var AirportDeparture =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var AirportDepartureController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ AirportDepartureController ] };
|
||||
var obj = {
|
||||
parents : [ AirportDepartureController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var AirportDirectory =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - AIRPORT DIRECTORY",
|
||||
_group : myCanvas.createGroup("AirportDirectoryLayer"),
|
||||
parents : [ NavMap, device.addPage("AirportDirectory", "AirportDirectoryGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
AirportDirectory,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "AirportDirectory", "WPT - AIRPORT DIRECTORY")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.AirportDirectoryStyles.new();
|
||||
obj.Options = fg1000.AirportDirectoryOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.AirportDirectoryController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var AirportDirectory =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.AirportDirectoryController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var AirportDirectory =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var AirportDirectoryController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ AirportDirectoryController ] };
|
||||
var obj = {
|
||||
parents : [ AirportDirectoryController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -1,42 +1,20 @@
|
|||
# AirportInfo
|
||||
var AirportInfo =
|
||||
{
|
||||
SURFACE_TYPES : {
|
||||
1 : "HARD SURFACE", # Asphalt
|
||||
2 : "HARD SURFACE", # Concrete
|
||||
3 : "TURF",
|
||||
4 : "DIRT",
|
||||
5 : "GRAVEL",
|
||||
# Helipads
|
||||
6 : "HARD SURFACE", # Asphalt
|
||||
7 : "HARD SURFACE", # Concrete
|
||||
8 : "TURF",
|
||||
9 : "DIRT",
|
||||
0 : "GRAVEL",
|
||||
},
|
||||
|
||||
|
||||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - AIRPORT INFORMATION",
|
||||
_group : myCanvas.createGroup("AirportInfoLayer"),
|
||||
parents : [ AirportInfo, device.addPage("AirportInfo", "AirportInfoGroup") ],
|
||||
parents : [
|
||||
AirportInfo,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "AirportInfo", "WPT - AIRPORT INFORMATION")
|
||||
],
|
||||
symbols : {},
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.AirportInfoStyles.new();
|
||||
obj.Options = fg1000.AirportInfoOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
# Need to display this underneath the softkeys, EIS, header.
|
||||
obj._group.set("z-index", -10.0);
|
||||
obj._group.setVisible(0);
|
||||
obj.crsrIdx = 0;
|
||||
|
||||
# Dynamic text elements in the SVG file. In the SVG these have an "AirportInfo" prefix.
|
||||
var textelements = [
|
||||
"ID",
|
||||
textelements = [
|
||||
"Usage",
|
||||
"Name",
|
||||
"City",
|
||||
|
@ -46,7 +24,6 @@ var AirportInfo =
|
|||
"Lon",
|
||||
"Fuel",
|
||||
"TZ",
|
||||
"Runway",
|
||||
"RwyDimensions",
|
||||
"RwySurface",
|
||||
"RwyLighting",
|
||||
|
@ -61,10 +38,36 @@ var AirportInfo =
|
|||
"Zoom"
|
||||
];
|
||||
|
||||
foreach (var element; textelements) {
|
||||
obj.symbols[element] = svg.getElementById("AirportInfo" ~ element);
|
||||
obj.symbols[element].setText("");
|
||||
}
|
||||
obj.addTextElements(textelements);
|
||||
|
||||
# Data Entry information. Keyed from the name of the element, which must
|
||||
# be one of the textelements above. Each data element maps to a set of
|
||||
# text elements in the SVG of the form [PageName][TextElement]{0...n}, each
|
||||
# representing a single character for data entry.
|
||||
#
|
||||
# .size is the number of characters of data entry
|
||||
# .chars is the set of characters, used to scroll through using the small
|
||||
# FMS knob.
|
||||
obj.airportEntry = PFD.DataEntryElement.new(obj.pageName, svg, "ID", "", 4, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||
|
||||
# TODO: Implement search by name - not currently supported.
|
||||
# obj.airportNameEntry = PFD.DataEntryElement.new(obj.pageName, svg, "Name", ???, "ABCDEFGHIJKLMNOPQRSTUVWXYZ ");
|
||||
|
||||
obj.runwaySelect = PFD.ScrollElement.new(obj.pageName, svg, "Runway", ["36","18"]); # Dummy values
|
||||
|
||||
obj.cursorElements = [
|
||||
obj.airportEntry,
|
||||
# obj.getTextElement("Name"),
|
||||
obj.runwaySelect,
|
||||
obj.getTextElement("Freq1"),
|
||||
obj.getTextElement("Freq2"),
|
||||
obj.getTextElement("Freq3"),
|
||||
obj.getTextElement("Freq4"),
|
||||
obj.getTextElement("Freq5"),
|
||||
obj.getTextElement("Freq6"),
|
||||
obj.getTextElement("Freq7"),
|
||||
obj.getTextElement("Freq8")
|
||||
];
|
||||
|
||||
# The Airport Chart
|
||||
obj.AirportChart = obj._group.createChild("map");
|
||||
|
@ -131,6 +134,140 @@ var AirportInfo =
|
|||
|
||||
return obj;
|
||||
},
|
||||
displayAirport : func(apt_info) {
|
||||
# Display a given airport
|
||||
me.AirportChart.getController().setPosition(apt_info.lat,apt_info.lon);
|
||||
me.airportEntry.setValue(apt_info.id);
|
||||
me.setTextElement("Usage", "PUBLIC");
|
||||
me.setTextElement("Name", string.uc(apt_info.name));
|
||||
me.setTextElement("City", "CITY");
|
||||
me.setTextElement("Region", "REGION");
|
||||
me.setTextElement("Alt", sprintf("%ift", M2FT * apt_info.elevation));
|
||||
|
||||
if (apt_info.lat < 0.0) {
|
||||
me.setTextElement("Lat", sprintf("S %.4f", -apt_info.lat));
|
||||
} else {
|
||||
me.setTextElement("Lat", sprintf("N %.4f", apt_info.lat));
|
||||
}
|
||||
|
||||
if (apt_info.lon < 0.0) {
|
||||
me.setTextElement("Lon", sprintf("W%3.4f", -apt_info.lon));
|
||||
} else {
|
||||
me.setTextElement("Lon", sprintf("E%3.4f", apt_info.lon));
|
||||
}
|
||||
|
||||
me.setTextElement("Fuel", "AVGAS, AVTUR");
|
||||
me.setTextElement("TZ", "UTC-6");
|
||||
|
||||
# Set up the runways list, but ignoring reciprocals so we don't get
|
||||
# runways displayed twice.
|
||||
var rwys = [];
|
||||
var recips = {};
|
||||
foreach(var rwy; keys(apt_info.runways)) {
|
||||
var rwy_info = apt_info.runways[rwy];
|
||||
if (recips[rwy_info.id] == nil) {
|
||||
var lbl = rwy_info.id ~ "-" ~ rwy_info.reciprocal.id;
|
||||
append(rwys, lbl);
|
||||
recips[rwy_info.reciprocal.id] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
me.runwaySelect.setValues(rwys);
|
||||
if (size(rwys) > 0) {
|
||||
me.displayRunway(apt_info.runways[keys(apt_info.runways)[0]]);
|
||||
} else {
|
||||
me.displayRunway(nil);
|
||||
}
|
||||
|
||||
# Display the comms frequencies for this airport
|
||||
var fcount = 1;
|
||||
|
||||
if (size(apt_info.comms()) > 0) {
|
||||
# Airport has one or more frequencies assigned to it.
|
||||
var freqs = {};
|
||||
var comms = apt_info.comms();
|
||||
|
||||
foreach (var c; comms) {
|
||||
freqs[c.ident] = sprintf("%.3f", c.frequency);;
|
||||
}
|
||||
|
||||
foreach (var c; sort(keys(freqs), string.icmp)) {
|
||||
me.setTextElement("FreqLabel" ~ fcount, c);
|
||||
me.setTextElement("Freq" ~ fcount, freqs[c]);
|
||||
fcount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
while (fcount < 9) {
|
||||
# zero remaining comms channels
|
||||
me.setTextElement("FreqLabel" ~ fcount, "");
|
||||
me.setTextElement("Freq" ~ fcount, "");
|
||||
fcount += 1;
|
||||
}
|
||||
},
|
||||
displayRunway : func(rwy_info) {
|
||||
if (rwy_info == nil) {
|
||||
me.setTextElement("RwyDimensions", "");
|
||||
me.setTextElement("RwySurface", "");
|
||||
} else {
|
||||
var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width);
|
||||
me.setTextElement("RwyDimensions", dim);
|
||||
|
||||
me.setTextElement("RwySurface", SURFACE_TYPES[rwy_info.surface]);
|
||||
#me.setTextElement("RwyLighting", rwy_info.surface);
|
||||
}
|
||||
},
|
||||
setZoom : func(zoom, label) {
|
||||
# Set the zoom level for the airport chart display
|
||||
me.AirportChart.setScreenRange(zoom);
|
||||
me.setTextElement("Zoom", label);
|
||||
},
|
||||
moveCRSR : func(val) {
|
||||
var incr_or_decr = (val > 0) ? 1 : -1;
|
||||
|
||||
if (me.cursorElements[me.crsrIdx].isInEdit()) {
|
||||
# We're editing an element, so let the element handle the movement itself
|
||||
me.cursorElements[me.crsrIdx].incrLarge(val);
|
||||
} else {
|
||||
# We're not currently editing an element, so move to the next cursor position.
|
||||
me.cursorElements[me.crsrIdx].unhighlightElement();
|
||||
print("Old cursor index " ~ me.crsrIdx);
|
||||
me.crsrIdx = math.mod(me.crsrIdx + incr_or_decr, size(me.cursorElements));
|
||||
|
||||
while ((me.cursorElements[me.crsrIdx].getValue() == nil) or
|
||||
(me.cursorElements[me.crsrIdx].getValue() == "" )) {
|
||||
# Handle case where we have blank frequencies by skipping them.
|
||||
me.crsrIdx = math.mod(me.crsrIdx + incr_or_decr, size(me.cursorElements));
|
||||
}
|
||||
|
||||
print("New cursor index " ~ me.crsrIdx ~ " " ~ size(me.cursorElements));
|
||||
me.cursorElements[me.crsrIdx].highlightElement();
|
||||
}
|
||||
},
|
||||
incrSmall : func(val) {
|
||||
me.cursorElements[me.crsrIdx].incrSmall(val);
|
||||
var ret = {};
|
||||
ret.name = me.cursorElements[me.crsrIdx].getName();
|
||||
ret.value = me.cursorElements[me.crsrIdx].getValue();
|
||||
return ret;
|
||||
},
|
||||
handleEnter : func() {
|
||||
me.cursorElements[me.crsrIdx].enterElement();
|
||||
var ret = {};
|
||||
ret.name = me.cursorElements[me.crsrIdx].getName();
|
||||
ret.value = me.cursorElements[me.crsrIdx].getValue();
|
||||
return ret;
|
||||
},
|
||||
handleClear : func() {
|
||||
me.cursorElements[me.crsrIdx].clearElement();
|
||||
},
|
||||
showCRSR : func() {
|
||||
me.cursorElements[me.crsrIdx].highlightElement();
|
||||
},
|
||||
hideCRSR : func() {
|
||||
me.cursorElements[me.crsrIdx].unhighlightElement();
|
||||
me.crsrIdx = 0;
|
||||
},
|
||||
offdisplay : func() {
|
||||
me._group.setVisible(0);
|
||||
|
||||
|
@ -148,82 +285,4 @@ var AirportInfo =
|
|||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
displayAirport : func(apt_info) {
|
||||
# Display a given airport
|
||||
me.AirportChart.getController().setPosition(apt_info.lat,apt_info.lon);
|
||||
me.symbols["ID"].setText(apt_info.id);
|
||||
me.symbols["Usage"].setText("PUBLIC");
|
||||
me.symbols["Name"].setText(string.uc(apt_info.name));
|
||||
me.symbols["City"].setText("CITY");
|
||||
me.symbols["Region"].setText("REGION");
|
||||
me.symbols["Alt"].setText(sprintf("%ift", 3.28 * apt_info.elevation));
|
||||
|
||||
if (apt_info.lat < 0.0) {
|
||||
me.symbols["Lat"].setText(sprintf("S %.4f", -apt_info.lat));
|
||||
} else {
|
||||
me.symbols["Lat"].setText(sprintf("N %.4f", apt_info.lat));
|
||||
}
|
||||
|
||||
if (apt_info.lon < 0.0) {
|
||||
me.symbols["Lon"].setText(sprintf("W%3.4f", -apt_info.lon));
|
||||
} else {
|
||||
me.symbols["Lon"].setText(sprintf("E%3.4f", apt_info.lon));
|
||||
}
|
||||
|
||||
me.symbols["Fuel"].setText("AVGAS");
|
||||
me.symbols["TZ"].setText("UTC-6");
|
||||
|
||||
# Display the comms frequencies for this airport
|
||||
var fcount = 1;
|
||||
|
||||
if (size(apt_info.comms()) > 0) {
|
||||
# Airport has one or more frequencies assigned to it.
|
||||
var freqs = {};
|
||||
var comms = apt_info.comms();
|
||||
|
||||
foreach (var c; comms) {
|
||||
freqs[c.ident] = sprintf("%.3f", c.frequency);;
|
||||
}
|
||||
|
||||
foreach (var c; sort(keys(freqs), string.icmp)) {
|
||||
me.symbols["FreqLabel" ~ fcount].setText(c);
|
||||
me.symbols["Freq" ~ fcount].setText(freqs[c]);
|
||||
fcount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
while (fcount < 9) {
|
||||
# zero remaining comms channels
|
||||
me.symbols["FreqLabel" ~ fcount].setText("");
|
||||
me.symbols["Freq" ~ fcount].setText("");
|
||||
fcount += 1;
|
||||
}
|
||||
},
|
||||
displayRunway : func(rwy_info) {
|
||||
var lbl = rwy_info.id ~ "-" ~ rwy_info.reciprocal.id;
|
||||
me.symbols["Runway"].setText(lbl);
|
||||
|
||||
var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width);
|
||||
me.symbols["RwyDimensions"].setText(dim);
|
||||
|
||||
me.symbols["RwySurface"].setText(me.SURFACE_TYPES[rwy_info.surface]);
|
||||
#me.symbols["RwyLighting"].setText(rwy_info.surface);
|
||||
},
|
||||
setZoom : func(zoom, label) {
|
||||
# Set the zoom level for the airport chart display
|
||||
me.AirportChart.setScreenRange(zoom);
|
||||
me.symbols["Zoom"].setText(label);
|
||||
},
|
||||
highlightElement : func(element) {
|
||||
var sym = me.symbols[element];
|
||||
sym.setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX);
|
||||
sym.setColorFill(fg1000.HIGHLIGHT_COLOR);
|
||||
sym.setColor(fg1000.HIGHLIGHT_TEXT_COLOR);
|
||||
},
|
||||
unhighlightElement : func(element) {
|
||||
var sym = me.symbols[element];
|
||||
sym.setDrawMode(canvas.Text.TEXT);
|
||||
sym.setColor(fg1000.NORMAL_TEXT_COLOR);
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -22,33 +22,16 @@ var AirportInfoController =
|
|||
{range: 0.5, label: "8nm"},
|
||||
{range: 0.4, label: "10nm"} ],
|
||||
|
||||
CRSR_ELEMENTS : [
|
||||
"ID",
|
||||
"Name",
|
||||
"Runway",
|
||||
"Freq1",
|
||||
"Freq2",
|
||||
"Freq3",
|
||||
"Freq4",
|
||||
"Freq5",
|
||||
"Freq6",
|
||||
"Freq7",
|
||||
"Freq8",
|
||||
],
|
||||
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ AirportInfoController ] };
|
||||
obj.airport = "";
|
||||
obj.runway = "";
|
||||
obj.runway_index = -1;
|
||||
obj.runwayIdx = -1;
|
||||
obj.info = nil;
|
||||
obj.page = page;
|
||||
obj.crsr_toggle = 0;
|
||||
obj.crsrIdx = 0;
|
||||
obj.crsrToggle = 0;
|
||||
obj.current_zoom = 7;
|
||||
obj.current_id_entry = "";
|
||||
|
||||
|
||||
# Emesary
|
||||
obj._recipient = nil;
|
||||
|
@ -63,45 +46,23 @@ var AirportInfoController =
|
|||
setAirport : func(id)
|
||||
{
|
||||
if (id == me.airport) return;
|
||||
me.airport = id;
|
||||
me.info= airportinfo(id);
|
||||
me.page.displayAirport(me.info);
|
||||
var apt = airportinfo(id);
|
||||
|
||||
# Display the first runway.
|
||||
me.setRunway(0);
|
||||
if (apt != nil) {
|
||||
me.airport = id;
|
||||
me.info= airportinfo(id);
|
||||
}
|
||||
|
||||
# Reset airport display. We do this irrespective of whether the id
|
||||
# is valid, as it allows us to clear any bad user input from the ID field
|
||||
me.page.displayAirport(me.info);
|
||||
},
|
||||
setRunway : func(runway_index)
|
||||
setRunway : func(runwayID)
|
||||
{
|
||||
if (runway_index == me.runway_index) return;
|
||||
var rwys = keys(me.info.runways);
|
||||
if (runway_index < 0) runway_index = 0;
|
||||
if (runway_index > (size(rwys) - 1)) runway_index = size(rwys) - 1;
|
||||
me.runway_index = runway_index;
|
||||
me.page.displayRunway(me.info.runways[rwys[runway_index]]);
|
||||
},
|
||||
incrRunway : func(value)
|
||||
{
|
||||
var incr_or_decr = (value > 0) ? 1 : -1;
|
||||
me.setRunway(me.runway_index + incr_or_decr);
|
||||
me.page.displayRunway(me.info.runways[runwayID]);
|
||||
},
|
||||
|
||||
# Control functions for Input
|
||||
incrAirportID : func(value)
|
||||
{
|
||||
var incr_or_decr = (value > 0) ? 1 : -1;
|
||||
if (me.current_id_entry == "") {
|
||||
me.current_id_entry = "A";
|
||||
} else {
|
||||
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
var fixed = substr(me.current_id_entry, 0, size(current_id_entry) - 2);
|
||||
var lastchar = substr(me.current_id_entry, -1);
|
||||
var char = math.mod(find(lastchar, alphabet) + incr_or_decr, 26);
|
||||
var nextchar = substr(alphabet, char, 1);
|
||||
me.current_id_entry = fixed + nextchar;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
zoomIn : func() {
|
||||
me.setZoom(me.current_zoom -1);
|
||||
},
|
||||
|
@ -118,53 +79,60 @@ var AirportInfoController =
|
|||
me.current_zoom = zoom;
|
||||
me.page.setZoom(me.RANGES[zoom].range * fg1000.MAP_PARTIAL.HEIGHT, me.RANGES[zoom].label);
|
||||
},
|
||||
showCRSR : func() {
|
||||
me.page.highlightElement(me.CRSR_ELEMENTS[me.crsrIdx]);
|
||||
},
|
||||
hideCRSR : func() {
|
||||
me.page.unhighlightElement(me.CRSR_ELEMENTS[me.crsrIdx]);
|
||||
me.crsrIdx = 0;
|
||||
},
|
||||
moveCRSR : func(val) {
|
||||
var incr_or_decr = (val > 0) ? 1 : -1;
|
||||
|
||||
me.page.unhighlightElement(me.CRSR_ELEMENTS[me.crsrIdx]);
|
||||
me.crsrIdx = math.mod(me.crsrIdx + incr_or_decr, size(me.CRSR_ELEMENTS) -1);
|
||||
me.page.highlightElement(me.CRSR_ELEMENTS[me.crsrIdx]);
|
||||
},
|
||||
handleCRSR : func() {
|
||||
me.crsr_toggle = (! me.crsr_toggle);
|
||||
print("CRSR pressed " ~ me.crsr_toggle);
|
||||
if (me.crsr_toggle) {
|
||||
me.showCRSR();
|
||||
me.crsrToggle = (! me.crsrToggle);
|
||||
if (me.crsrToggle) {
|
||||
me.page.showCRSR();
|
||||
} else {
|
||||
me.hideCRSR();
|
||||
me.page.hideCRSR();
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
},
|
||||
handleFMSInner : func(value) {
|
||||
if (me.crsr_toggle == 1) {
|
||||
print("FMSInner for AirportInfoController called " ~ me.crsr_toggle);
|
||||
if (me.CRSR_ELEMENTS[me.crsrIdx] == "Runway") {
|
||||
me.incrRunway(value);
|
||||
}
|
||||
if (me.CRSR_ELEMENTS[me.crsrIdx] == "ID") {
|
||||
me.incrAirportID(value);
|
||||
if (me.crsrToggle == 1) {
|
||||
var select = me.page.incrSmall(value);
|
||||
if ((select.name == "AirportInfoRunway") and (select.value != nil)) {
|
||||
# Selection values are of the form "06L-12R". We need to set the
|
||||
# runway to the left half.
|
||||
var idx = find("-", select.value);
|
||||
if (idx != -1) {
|
||||
var rwy = substr(select.value, 0, idx);
|
||||
me.setRunway(rwy);
|
||||
}
|
||||
}
|
||||
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return me.page.mfd._pageGroupController.handleFMSInner(value);
|
||||
}
|
||||
},
|
||||
handleFMSOuter : func(value) {
|
||||
if (me.crsr_toggle == 1) {
|
||||
print("FMSOuter for AirportInfoController called " ~ me.crsr_toggle);
|
||||
me.moveCRSR(value);
|
||||
if (me.crsrToggle == 1) {
|
||||
me.page.moveCRSR(value);
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return me.page.mfd._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me.crsrToggle == 1) {
|
||||
var select = me.page.handleEnter();
|
||||
if (select.name == "AirportInfoID") me.setAirport(select.value);
|
||||
if (substr(select.name, 0, 15) == "AirportInfoFreq") print("Enter pressed on frequency " ~ select.value);
|
||||
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
handleClear : func(value) {
|
||||
if (me.crsrToggle == 1) {
|
||||
# Cancel any data entry
|
||||
me.page.handleClear();
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
@ -183,10 +151,12 @@ var AirportInfoController =
|
|||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.MFD.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.MFD.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.MFD.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.MFD.FASCIA.RANGE) return controller.zoom(value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.RANGE) return controller.zoom(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
if (id == fg1000.FASCIA.CLR) return controller.handleClear(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
|
|
|
@ -4,28 +4,12 @@ var AirportWeather =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - WEATHER INFORMATION",
|
||||
_group : myCanvas.createGroup("AirportWeatherLayer"),
|
||||
parents : [ NavMap, device.addPage("AirportWeather", "AirportWeatherGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
AirportWeather,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "AirportWeather", "WPT - WEATHER INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.AirportWeatherStyles.new();
|
||||
obj.Options = fg1000.AirportWeatherOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.AirportWeatherController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var AirportWeather =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.AirportWeatherController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var AirportWeather =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var AirportWeatherController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ AirportWeatherController ] };
|
||||
var obj = {
|
||||
parents : [ AirportWeatherController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Checklist1 =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "LST - CHECKLIST 1",
|
||||
_group : myCanvas.createGroup("Checklist1Layer"),
|
||||
parents : [ NavMap, device.addPage("Checklist1", "Checklist1Group") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Checklist1,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Checklist1", "LST - CHECKLIST 1")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.Checklist1Styles.new();
|
||||
obj.Options = fg1000.Checklist1Options.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.Checklist1Controller.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Checklist1 =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.Checklist1Controller.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Checklist1 =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var Checklist1Controller =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ Checklist1Controller ] };
|
||||
var obj = {
|
||||
parents : [ Checklist1Controller ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Checklist2 =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "LST - CHECKLIST 2",
|
||||
_group : myCanvas.createGroup("Checklist2Layer"),
|
||||
parents : [ NavMap, device.addPage("Checklist2", "Checklist2Group") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Checklist2,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Checklist2", "LST - CHECKLIST 2")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.Checklist2Styles.new();
|
||||
obj.Options = fg1000.Checklist2Options.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.Checklist2Controller.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Checklist2 =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.Checklist2Controller.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Checklist2 =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var Checklist2Controller =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ Checklist2Controller ] };
|
||||
var obj = {
|
||||
parents : [ Checklist2Controller ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Checklist3 =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "LST - CHECKLIST 3",
|
||||
_group : myCanvas.createGroup("Checklist3Layer"),
|
||||
parents : [ NavMap, device.addPage("Checklist3", "Checklist3Group") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Checklist3,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Checklist3", "LST - CHECKLIST 3")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.Checklist3Styles.new();
|
||||
obj.Options = fg1000.Checklist3Options.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.Checklist3Controller.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Checklist3 =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.Checklist3Controller.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Checklist3 =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var Checklist3Controller =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ Checklist3Controller ] };
|
||||
var obj = {
|
||||
parents : [ Checklist3Controller ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Checklist4 =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "LST - CHECKLIST 4",
|
||||
_group : myCanvas.createGroup("Checklist4Layer"),
|
||||
parents : [ NavMap, device.addPage("Checklist4", "Checklist4Group") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Checklist4,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Checklist4", "LST - CHECKLIST 4")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.Checklist4Styles.new();
|
||||
obj.Options = fg1000.Checklist4Options.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.Checklist4Controller.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Checklist4 =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.Checklist4Controller.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Checklist4 =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var Checklist4Controller =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ Checklist4Controller ] };
|
||||
var obj = {
|
||||
parents : [ Checklist4Controller ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Checklist5 =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "LST - CHECKLIST 5",
|
||||
_group : myCanvas.createGroup("Checklist5Layer"),
|
||||
parents : [ NavMap, device.addPage("Checklist5", "Checklist5Group") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Checklist5,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Checklist5", "LST - CHECKLIST 5")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.Checklist5Styles.new();
|
||||
obj.Options = fg1000.Checklist5Options.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.Checklist5Controller.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Checklist5 =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.Checklist5Controller.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Checklist5 =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var Checklist5Controller =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ Checklist5Controller ] };
|
||||
var obj = {
|
||||
parents : [ Checklist5Controller ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var FlightPlanCatalog =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "FPL - FLIGHT PLAN CATALOG",
|
||||
_group : myCanvas.createGroup("FlightPlanCatalogLayer"),
|
||||
parents : [ NavMap, device.addPage("FlightPlanCatalog", "FlightPlanCatalogGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
FlightPlanCatalog,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "FlightPlanCatalog", "FPL - FLIGHT PLAN CATALOG")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.FlightPlanCatalogStyles.new();
|
||||
obj.Options = fg1000.FlightPlanCatalogOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.FlightPlanCatalogController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var FlightPlanCatalog =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.FlightPlanCatalogController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var FlightPlanCatalog =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var FlightPlanCatalogController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ FlightPlanCatalogController ] };
|
||||
var obj = {
|
||||
parents : [ FlightPlanCatalogController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var GPSStatus =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "AUX - GPS STATUS",
|
||||
_group : myCanvas.createGroup("GPSStatusLayer"),
|
||||
parents : [ NavMap, device.addPage("GPSStatus", "GPSStatusGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
GPSStatus,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "GPSStatus", "AUX - GPS STATUS")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.GPSStatusStyles.new();
|
||||
obj.Options = fg1000.GPSStatusOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.GPSStatusController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var GPSStatus =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.GPSStatusController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var GPSStatus =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var GPSStatusController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ GPSStatusController ] };
|
||||
var obj = {
|
||||
parents : [ GPSStatusController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var IntersectionInfo =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - INTERSECTION INFORMATION",
|
||||
_group : myCanvas.createGroup("IntersectionInfoLayer"),
|
||||
parents : [ NavMap, device.addPage("IntersectionInfo", "IntersectionInfoGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
IntersectionInfo,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "IntersectionInfo", "WPT - INTERSECTION INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.IntersectionInfoStyles.new();
|
||||
obj.Options = fg1000.IntersectionInfoOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.IntersectionInfoController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var IntersectionInfo =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.IntersectionInfoController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var IntersectionInfo =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var IntersectionInfoController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ IntersectionInfoController ] };
|
||||
var obj = {
|
||||
parents : [ IntersectionInfoController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
# FG1000 MFD
|
||||
|
||||
print("##############");
|
||||
print("# FG1000 MFD #");
|
||||
print("##############\n");
|
||||
|
||||
io.include("constants.nas");
|
||||
|
||||
var nasal_dir = getprop("/sim/fg-root") ~ "/Aircraft/Instruments-3d/FG1000/Nasal/";
|
||||
|
||||
io.load_nasal(nasal_dir ~ '/MFDPage.nas', "fg1000");
|
||||
|
||||
var MFDPages = [
|
||||
"NavMap",
|
||||
"NavigationMap",
|
||||
"TrafficMap",
|
||||
"Stormscope",
|
||||
"WeatherDataLink",
|
||||
|
@ -53,58 +61,9 @@ io.load_nasal(nasal_dir ~ 'EIS.nas', "fg1000");
|
|||
io.load_nasal(nasal_dir ~ 'Drivers/EISDriver.nas', "fg1000");
|
||||
io.load_nasal(nasal_dir ~ 'PageGroupController.nas', "fg1000");
|
||||
|
||||
# Constants to define the display area, for placement of elements. We
|
||||
# could try to do something with a layout, but the position and size of
|
||||
# elements is fixed. Can't be member variables of MFD as they are
|
||||
# self-referential.
|
||||
|
||||
var DISPLAY = { WIDTH : 1024, HEIGHT : 768 };
|
||||
var HEADER_HEIGHT = 56;
|
||||
var FOOTER_HEIGHT = 25;
|
||||
var EIS_WIDTH = 150;
|
||||
|
||||
# Size of data display on the right hand side of the MFD
|
||||
var DATA_DISPLAY = {
|
||||
WIDTH : 300,
|
||||
HEIGHT : DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT,
|
||||
X : DISPLAY.WIDTH - 300,
|
||||
Y : HEADER_HEIGHT,
|
||||
};
|
||||
|
||||
# Map dimensions when the data display is not present
|
||||
var MAP_FULL = {
|
||||
CENTER : { X : ((DISPLAY.WIDTH - EIS_WIDTH) / 2 + EIS_WIDTH),
|
||||
Y : ((DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT) / 2 + HEADER_HEIGHT), },
|
||||
X : EIS_WIDTH,
|
||||
Y : HEADER_HEIGHT,
|
||||
WIDTH : DISPLAY.WIDTH - EIS_WIDTH,
|
||||
HEIGHT : DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT,
|
||||
};
|
||||
|
||||
# Map dimensions when the data display is present
|
||||
var MAP_PARTIAL = {
|
||||
X : EIS_WIDTH,
|
||||
Y : HEADER_HEIGHT,
|
||||
WIDTH : DISPLAY.WIDTH - EIS_WIDTH - DATA_DISPLAY.WIDTH,
|
||||
HEIGHT : DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT,
|
||||
CENTER : { X : ((DISPLAY.WIDTH - EIS_WIDTH - DATA_DISPLAY.WIDTH) / 2 + EIS_WIDTH),
|
||||
Y : ((DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT) / 2 + HEADER_HEIGHT), },
|
||||
};
|
||||
|
||||
var HIGHLIGHT_COLOR = "#80ffff";
|
||||
var HIGHLIGHT_TEXT_COLOR = "#000000";
|
||||
var NORMAL_TEXT_COLOR = "#80ffff";
|
||||
|
||||
var MFD =
|
||||
{
|
||||
# Constants for the hard-buttons on the fascia
|
||||
FASCIA : {
|
||||
FMS_OUTER : 0,
|
||||
FMS_INNER : 1,
|
||||
RANGE : 2,
|
||||
FMS_CRSR : 3,
|
||||
},
|
||||
|
||||
new : func (myCanvas)
|
||||
{
|
||||
var obj = { parents : [ MFD ] };
|
||||
|
@ -152,16 +111,19 @@ var MFD =
|
|||
addPageFn();
|
||||
}
|
||||
|
||||
# The NavigationMap page is a special case, as it is displayed with the Nearest... pages as an overlay
|
||||
obj.NavigationMap = obj._pageGroupController.getPage("NavigationMap");
|
||||
|
||||
# Display the NavMap and the appropriate top level on startup.
|
||||
obj._MFDDevice.selectPage(obj._pageGroupController.getPage("NavMap"));
|
||||
obj._MFDDevice.selectPage(obj.NavigationMap);
|
||||
|
||||
# Add a wheel controller., which we will attach to the zoom.
|
||||
myCanvas.addEventListener("wheel", func(e)
|
||||
{
|
||||
if (e.deltaY >0) {
|
||||
obj._MFDDevice.current_page.controller.zoomIn();
|
||||
obj._MFDDevice.current_page.controller.handleFMSInner(1);
|
||||
} else {
|
||||
obj._MFDDevice.current_page.controller.zoomOut();
|
||||
obj._MFDDevice.current_page.controller.handleFMSInner(-1);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -177,7 +139,9 @@ var MFD =
|
|||
},
|
||||
del: func()
|
||||
{
|
||||
me.getCurrentPage().DeRegisterWithEmesary();
|
||||
me._MFDDevice.current_page.offdisplay();
|
||||
me._MFDDevice.DeRegisterWithEmesary();
|
||||
|
||||
},
|
||||
setPageTitle: func(title)
|
||||
{
|
||||
|
|
68
Aircraft/Instruments-3d/FG1000/Nasal/MFDPage.nas
Normal file
|
@ -0,0 +1,68 @@
|
|||
# FG1000 MFD Page base class
|
||||
|
||||
# Load the PFD UI Elements
|
||||
var mfd_dir = getprop("/sim/fg-root") ~ "/Nasal/canvas/PFD/";
|
||||
var loadPFDFile = func(file) io.load_nasal(mfd_dir ~ file, "PFD");
|
||||
|
||||
loadPFDFile("DefaultStyle.nas");
|
||||
loadPFDFile("UIElement.nas");
|
||||
loadPFDFile("TextElement.nas");
|
||||
loadPFDFile("ArrowElement.nas");
|
||||
loadPFDFile("GroupElement.nas");
|
||||
loadPFDFile("ScrollElement.nas");
|
||||
loadPFDFile("DataEntryElement.nas");
|
||||
|
||||
var MFDPage =
|
||||
{
|
||||
|
||||
new : func (mfd, myCanvas, device, SVGGroup, pageName, title)
|
||||
{
|
||||
var obj = {
|
||||
pageName : pageName,
|
||||
_group : myCanvas.createGroup(pageName ~ "Layer"),
|
||||
_SVGGroup : SVGGroup,
|
||||
parents : [ MFDPage, device.addPage(title, pageName ~ "Group") ],
|
||||
_symbols : {},
|
||||
};
|
||||
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
# Pick up Style, Options and Controller
|
||||
var code = "obj.Styles = fg1000." ~ pageName ~ "Styles.new(); " ~
|
||||
"obj.Options = fg1000." ~ pageName ~ "Options.new();";
|
||||
var createStylesAndOptions = compile(code);
|
||||
createStylesAndOptions();
|
||||
|
||||
# Need to display this underneath the softkeys, EIS, header.
|
||||
obj._group.set("z-index", -10.0);
|
||||
obj._group.setVisible(0);
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
addTextElements : func(symbols) {
|
||||
foreach (var s; symbols) {
|
||||
me._symbols[s] = PFD.TextElement.new(me.pageName, me._SVGGroup, s);
|
||||
}
|
||||
},
|
||||
|
||||
getTextElement : func(symbolName) {
|
||||
return me._symbols[symbolName];
|
||||
assert(sym != nil, "Unknown text element " ~ symbolName ~ " (check your addTextElements call?)");
|
||||
},
|
||||
|
||||
getTextValue : func(symbolName) {
|
||||
var sym = me._symbols[symbolName];
|
||||
assert(sym != nil, "Unknown text element " ~ symbolName ~ " (check your addTextElements call?)");
|
||||
return sym.getValue();
|
||||
},
|
||||
|
||||
setTextElement : func(symbolName, value) {
|
||||
var sym = me._symbols[symbolName];
|
||||
assert(sym != nil, "Unknown text element " ~ symbolName ~ " (check your addTextElements call?)");
|
||||
if (value == nil ) value = "";
|
||||
sym.setValue(value);
|
||||
}
|
||||
|
||||
};
|
|
@ -4,28 +4,12 @@ var NDBInfo =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - NDB INFORMATION",
|
||||
_group : myCanvas.createGroup("NDBInfoLayer"),
|
||||
parents : [ NavMap, device.addPage("NDBInfo", "NDBInfoGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NDBInfo,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NDBInfo", "WPT - NDB INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NDBInfoStyles.new();
|
||||
obj.Options = fg1000.NDBInfoOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NDBInfoController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NDBInfo =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NDBInfoController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NDBInfo =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NDBInfoController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NDBInfoController ] };
|
||||
var obj = {
|
||||
parents : [ NDBInfoController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -1,26 +1,30 @@
|
|||
# Navigation Map
|
||||
var NavMap =
|
||||
var NavigationMap =
|
||||
{
|
||||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "MAP - NAVIGATION MAP",
|
||||
_group : myCanvas.createGroup("NavigationMapLayer"),
|
||||
parents : [ NavMap, device.addPage("NavigationMap", "NavigationMapGroup") ]
|
||||
parents : [
|
||||
NavigationMap,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NavigationMap", "MAP - NAVIGATION MAP")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NavMapStyles.new();
|
||||
obj.Options = fg1000.NavMapOptions.new();
|
||||
obj.MFDMap = obj._group.createChild("map");
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
obj.MFDMap.setScreenRange(689/2.0);
|
||||
|
||||
# Need to display this underneath the softkeys, EIS, header.
|
||||
obj._group.set("z-index", -10.0);
|
||||
obj._group.setVisible(0);
|
||||
# Labels for map range and orientation. Two sets - one for the full display
|
||||
# and another for the partial display.
|
||||
obj.addTextElements(["RangeDisplay", "Orientation"]);
|
||||
obj.addTextElements(["RangeDisplayPartial", "OrientationPartial"]);
|
||||
|
||||
obj._labelsFull = svg.getElementById("NavigationMapGroupFull");
|
||||
assert(obj._labelsFull != nil, "Unable to find NavigationMapGroupFull");
|
||||
|
||||
# Initialize the controller:
|
||||
obj._labelsPartial = svg.getElementById("NavigationMapGroupPartial");
|
||||
assert(obj._labelsPartial != nil, "Unable to find NavigationMapGroupPartial");
|
||||
|
||||
# Initialize the controllers:
|
||||
var ctrl_ns = canvas.Map.Controller.get("Aircraft position");
|
||||
var source = ctrl_ns.SOURCES["current-pos"];
|
||||
if (source == nil) {
|
||||
|
@ -64,8 +68,6 @@ var NavMap =
|
|||
options: obj.Options.getOption(type.name) );
|
||||
}
|
||||
|
||||
obj.controller = fg1000.NavMapController.new(obj, svg, "RangeDisplay", 8);
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -182,6 +184,8 @@ var NavMap =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NavigationMapController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
toggleLayerVisible : func(name) {
|
||||
|
@ -190,8 +194,14 @@ var NavMap =
|
|||
setLayerVisible : func(name,n=1) {
|
||||
me.MFDMap.getLayer(name).setVisible(n);
|
||||
},
|
||||
setRange : func(range) {
|
||||
setRange : func(range, label) {
|
||||
me.MFDMap.setRange(range);
|
||||
me.setTextElement("RangeDisplay", label);
|
||||
me.setTextElement("RangeDisplayPartial", label);
|
||||
},
|
||||
setOrientation : func(orientation) {
|
||||
me.setTextElement("Orientation", orientation);
|
||||
me.setTextElement("OrientationPartial", orientation);
|
||||
},
|
||||
setScreenRange : func(range) {
|
||||
me.MFDMap.setScreenRange(range);
|
||||
|
@ -210,7 +220,36 @@ var NavMap =
|
|||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
|
||||
# Center the map's origin, modified to take into account the surround.
|
||||
me.MFDMap.setTranslation(
|
||||
fg1000.MAP_FULL.CENTER.X,
|
||||
fg1000.MAP_FULL.CENTER.Y
|
||||
);
|
||||
|
||||
me._labelsFull.setVisible(1);
|
||||
me._labelsPartial.setVisible(0);
|
||||
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
|
||||
# Display functions when we're displaying the NavigationMap as part of another
|
||||
# page - e.g. NearestAirports.
|
||||
ondisplayPartial : func() {
|
||||
me._group.setVisible(1);
|
||||
me.MFDMap.setTranslation(
|
||||
fg1000.MAP_PARTIAL.CENTER.X,
|
||||
fg1000.MAP_PARTIAL.CENTER.Y
|
||||
);
|
||||
|
||||
me._labelsFull.setVisible(0);
|
||||
me._labelsPartial.setVisible(1);
|
||||
|
||||
me.controller.ondisplayPartial();
|
||||
},
|
||||
offdisplayPartial : func() {
|
||||
me._group.setVisible(0);
|
||||
me.controller.offdisplayPartial();
|
||||
},
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
# Navigation Map Controller
|
||||
var NavMapController =
|
||||
var NavigationMapController =
|
||||
{
|
||||
# Vertical ranges, and labels.
|
||||
# 28 ranges from 500ft to 2000nm, measuring the vertical map distance.
|
||||
|
@ -34,6 +34,13 @@ var NavMapController =
|
|||
{range: 1500, label: "1500nm"},
|
||||
{range: 2000, label: "2000nm"}, ],
|
||||
|
||||
ORIENTATIONS : [
|
||||
{ label: "NORTH UP" },
|
||||
{ label: "TRK UP" },
|
||||
{ label: "DTK UP" },
|
||||
{ label: "HDG UP" },
|
||||
],
|
||||
|
||||
# Layer display configuration:
|
||||
# enabled - whether this layer has been enabled by the user
|
||||
# declutter - the maximum declutter level (0-3) that this layer is visible in
|
||||
|
@ -71,19 +78,20 @@ var NavMapController =
|
|||
# Airways levels.
|
||||
AIRWAYS : [ "AIRWAYS", "AIRWY ON", "AIRWY LO", "AIRWY HI"],
|
||||
|
||||
new : func (page, svg, zoom_label, current_zoom)
|
||||
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NavMapController ] };
|
||||
obj.current_zoom = current_zoom;
|
||||
var obj = { parents : [ NavigationMapController ] };
|
||||
obj.current_zoom = 8;
|
||||
obj.declutter = 0;
|
||||
obj.airways = 0;
|
||||
obj.page = page;
|
||||
obj.page.setScreenRange(689/2.0);
|
||||
obj.label = svg.getElementById(zoom_label);
|
||||
obj.setZoom(obj.current_zoom);
|
||||
obj.setOrientation(obj.ORIENTATIONS[0]);
|
||||
|
||||
# Emesary
|
||||
obj._recipient = nil;
|
||||
obj._zoomRecipient = nil;
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
@ -104,10 +112,12 @@ var NavMapController =
|
|||
# Ranges above represent vertical ranges, but the display is a rectangle, so
|
||||
# we need to use the diagonal range of the 1024 x 689, which is 617px.
|
||||
# 617px is 1.8 x 689/2, so we need to increase the range values by x1.8
|
||||
me.page.setRange(me.RANGES[zoom].range);
|
||||
me.label.setText(me.RANGES[zoom].label);
|
||||
me.page.setRange(me.RANGES[zoom].range, me.RANGES[zoom].label);
|
||||
me.updateVisibility();
|
||||
},
|
||||
setOrientation : func(orientation) {
|
||||
me.page.setOrientation(orientation.label);
|
||||
},
|
||||
updateVisibility : func() {
|
||||
# Determine which layers should be visible.
|
||||
foreach (var layer_name; keys(me.LAYER_RANGES)) {
|
||||
|
@ -164,7 +174,7 @@ var NavMapController =
|
|||
# bottom right of the screen
|
||||
return me.page.mfd._pageGroupController.handleFMSOuter(value);
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
RegisterWithEmesary : func(transmitter = nil) {
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
|
@ -182,9 +192,9 @@ var NavMapController =
|
|||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.MFD.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.MFD.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.MFD.FASCIA.RANGE) return controller.zoom(value);
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.RANGE) return controller.zoom(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
|
@ -193,7 +203,7 @@ var NavMapController =
|
|||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
DeRegisterWithEmesary : func(transmitter = nil) {
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
|
@ -206,4 +216,51 @@ var NavMapController =
|
|||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
# Set controller for cases where the NavigationMap is displayed as part of
|
||||
# another page, e.g. NearestAirports
|
||||
#
|
||||
# In this case we are only interested in a subset of the buttons to control
|
||||
# the map.
|
||||
|
||||
RegisterZoomWithEmesary : func(transmitter = nil) {
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._zoomRecipient == nil){
|
||||
me._zoomRecipient = emesary.Recipient.new("NavMapController_" ~ me.page.device.designation);
|
||||
var pfd_obj = me.page.device;
|
||||
var controller = me;
|
||||
me._zoomRecipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.RANGE) return controller.zoom(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._zoomRecipient);
|
||||
me.zoomTransmitter = transmitter;
|
||||
},
|
||||
DeRegisterZoomWithEmesary : func(transmitter = nil) {
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.zoomTransmitter != nil)
|
||||
me.zoomTransmitter.DeRegister(me._zoomRecipient);
|
||||
me.zoomTransmitter = nil;
|
||||
},
|
||||
|
||||
ondisplayPartial : func() {
|
||||
me.RegisterZoomWithEmesary();
|
||||
},
|
||||
offdisplayPartial : func() {
|
||||
me.DeRegisterZoomWithEmesary();
|
||||
},
|
||||
};
|
|
@ -1,8 +1,8 @@
|
|||
# Navigation Map Options
|
||||
var NavMapOptions =
|
||||
var NavigationMapOptions =
|
||||
{
|
||||
new : func() {
|
||||
var obj = { parents : [NavMapOptions] };
|
||||
var obj = { parents : [NavigationMapOptions] };
|
||||
obj.Options= {};
|
||||
obj.loadOptions();
|
||||
return obj;
|
|
@ -1,8 +1,8 @@
|
|||
# Navigation Map Styles
|
||||
var NavMapStyles =
|
||||
var NavigationMapStyles =
|
||||
{
|
||||
new : func() {
|
||||
var obj = { parents : [ NavMapStyles ]};
|
||||
var obj = { parents : [ NavigationMapStyles ]};
|
||||
obj.Styles = {};
|
||||
obj.loadStyles();
|
||||
return obj;
|
|
@ -4,75 +4,228 @@ var NearestAirports =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST AIRPORTS",
|
||||
_group : myCanvas.createGroup("NearestAirportsLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestAirports", "NearestAirportsGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestAirports,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestAirports", "NRST - NEAREST AIRPORTS")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestAirportsStyles.new();
|
||||
obj.Options = fg1000.NearestAirportsOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestAirportsController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
# Dynamic elements. There are 4 different sets of dynamic elements:
|
||||
#
|
||||
# Nearest Airports - this is a scrolling list of up to 25 airports within 200nm, shown 5 at a time.
|
||||
# Runways - just a single scroll element
|
||||
# Frequencies - 3 displayed in a scrolling list
|
||||
# Approaches - 3 displayed in a scrolling list
|
||||
#
|
||||
# Selection is via softkeys, the FMS knob, or via the page menu.
|
||||
|
||||
];
|
||||
obj.airportSelect = PFD.GroupElement.new(
|
||||
obj.pageName,
|
||||
svg,
|
||||
[ "Arrow", "ID", "CRS", "DST"],
|
||||
5,
|
||||
"Arrow",
|
||||
1
|
||||
);
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
obj.runwaySelect = PFD.ScrollElement.new(obj.pageName, svg, "RunwayID", [36,18]); # Dummy values
|
||||
|
||||
obj.freqSelect = PFD.GroupElement.new(
|
||||
obj.pageName,
|
||||
svg,
|
||||
["FreqLabel", "Freq"],
|
||||
3,
|
||||
"Freq"
|
||||
);
|
||||
|
||||
obj.approachSelect = PFD.GroupElement.new(
|
||||
obj.pageName,
|
||||
svg,
|
||||
["Approach"],
|
||||
3,
|
||||
"Approach"
|
||||
);
|
||||
|
||||
# Other dynamic text elements
|
||||
obj.addTextElements(["Name", "Alt", "RunwaySurface", "RunwayDimensions"]);
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
pg.resetMenuColors(device);
|
||||
pg.addMenuItem(4, "APT", pg,
|
||||
func(dev, pg, mi) { pg.controller.selectAirports(); device.updateMenus(); }, # callback
|
||||
func(svg, mi) { pg.display_toggle(device, svg, mi, NearestAirportsController.UIGROUP.APT); }
|
||||
);
|
||||
|
||||
pg.addMenuItem(5, "RNWY", pg,
|
||||
func(dev, pg, mi) { pg.controller.selectRunways(); device.updateMenus(); }, # callback
|
||||
func(svg, mi) { pg.display_toggle(device, svg, mi, NearestAirportsController.UIGROUP.RNWY); }
|
||||
);
|
||||
|
||||
pg.addMenuItem(6, "FREQ", pg,
|
||||
func(dev, pg, mi) { pg.controller.selectFrequencies(); device.updateMenus(); }, # callback
|
||||
func(svg, mi) { pg.display_toggle(device, svg, mi, NearestAirportsController.UIGROUP.FREQ); }
|
||||
);
|
||||
|
||||
pg.addMenuItem(7, "APR", pg,
|
||||
func(dev, pg, mi) { pg.controller.selectApproaches(); device.updateMenus(); }, # callback
|
||||
func(svg, mi) { pg.display_toggle(device, svg, mi, NearestAirportsController.UIGROUP.APR); }
|
||||
);
|
||||
|
||||
device.updateMenus();
|
||||
};
|
||||
|
||||
# Display map toggle softkeys which change color depending
|
||||
# on whether a particular layer is enabled or not.
|
||||
var display_toggle = func(device, svg, mi, layer) {
|
||||
var bg_name = sprintf("SoftKey%d-bg",mi.menu_id);
|
||||
if (obj.controller.isEnabled(layer)) {
|
||||
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
|
||||
};
|
||||
|
||||
# Function to undo any colors set by display_toggle when loading a new menu
|
||||
var resetMenuColors = func(device) {
|
||||
for(var i = 0; i < 12; i +=1) {
|
||||
var name = sprintf("SoftKey%d",i);
|
||||
device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
}
|
||||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
# Indicate which group is selected by colour of the softkeys
|
||||
display_toggle : func(device, svg, mi, group) {
|
||||
var bg_name = sprintf("SoftKey%d-bg",mi.menu_id);
|
||||
if (me.controller.getSelectedGroup() == group) {
|
||||
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
|
||||
},
|
||||
|
||||
# Function to highlight the APT softkey - used when CRSR is pressed to indicate
|
||||
# that we're editing the airports selection.
|
||||
selectAirports : func() {
|
||||
me.resetMenuColors(me.device);
|
||||
var bg_name = sprintf("SoftKey%d-bg",4);
|
||||
var tname = sprintf("SoftKey%d",4);
|
||||
me.device.svg.getElementById(bg_name).setColorFill(0.5,0.5,0.5);
|
||||
me.device.svg.getElementById(tname).setColor(0.0,0.0,0.0);
|
||||
},
|
||||
|
||||
# Clear any cursor, highlights. Used when exiting from CRSR mode
|
||||
resetCRSR : func() {
|
||||
me.runwaySelect.unhighlightElement();
|
||||
me.freqSelect.hideCRSR();
|
||||
me.approachSelect.hideCRSR();
|
||||
me.resetMenuColors(me.device);
|
||||
},
|
||||
|
||||
# Function to undo any colors set by display_toggle when loading a new menu
|
||||
resetMenuColors : func(device) {
|
||||
for(var i = 0; i < 12; i +=1) {
|
||||
var name = sprintf("SoftKey%d",i);
|
||||
device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
},
|
||||
|
||||
offdisplay : func() {
|
||||
me._group.setVisible(0);
|
||||
# The Nearest... pages use the underlying navigation map.
|
||||
me.mfd.NavigationMap.offdisplayPartial();
|
||||
|
||||
# Reset the menu colours. Shouldn't have to do this here, but
|
||||
# there's not currently an obvious other location to do so.
|
||||
for(var i = 0; i < 12; i +=1) {
|
||||
var name = sprintf("SoftKey%d",i);
|
||||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.resetMenuColors(me.device);
|
||||
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.controller.ondisplay();
|
||||
|
||||
# The Nearest... pages use the underlying navigation map.
|
||||
me.mfd.NavigationMap.ondisplayPartial();
|
||||
|
||||
me.mfd.setPageTitle(me.title);
|
||||
|
||||
},
|
||||
updateAirports : func(apts) {
|
||||
|
||||
var airportlist = [];
|
||||
for (var i = 0; i < size(apts); i = i + 1) {
|
||||
var apt = apts[i];
|
||||
var crsAndDst = courseAndDistance(apt);
|
||||
var crs = sprintf("%i", crsAndDst[0]);
|
||||
var dst = sprintf("%.1fnm", crsAndDst[1]);
|
||||
|
||||
# Convert into something we can pass straight to the UIGroup.
|
||||
append(airportlist, {
|
||||
Arrow : apt.id,
|
||||
ID: apt.id,
|
||||
CRS: crs,
|
||||
DST: dst,
|
||||
});
|
||||
}
|
||||
|
||||
me.airportSelect.setValues(airportlist);
|
||||
|
||||
if (size(airportlist) > 0) {
|
||||
me.updateAirportData(apts[0]);
|
||||
me.airportSelect.showCRSR();
|
||||
} else {
|
||||
me.airportSelect.hideCRSR();
|
||||
me.setTextElement("Name", "NONE WITHIN 200NM");
|
||||
me.setTextElement("Alt", "");
|
||||
}
|
||||
},
|
||||
updateAirportData : func(apt) {
|
||||
me.setTextElement("Name", apt.name);
|
||||
me.setTextElement("Alt", sprintf("%ift", M2FT * apt.elevation));
|
||||
|
||||
var runwaylist = keys(apt.runways);
|
||||
|
||||
if (size(runwaylist) > 0) {
|
||||
me.runwaySelect.setValues(runwaylist);
|
||||
me.updateRunwayInfo(apt.runways[runwaylist[0]]);
|
||||
} else {
|
||||
me.runwaySelect.setValues([""]);
|
||||
me.updateRunwayInfo(nil);
|
||||
}
|
||||
|
||||
var freqarray = [];
|
||||
var apt_comms = apt.comms();
|
||||
if (size(apt_comms) > 0) {
|
||||
# Airport has one or more frequencies assigned to it.
|
||||
var freqs = {};
|
||||
foreach (var c; apt_comms) {
|
||||
freqs[c.ident] = sprintf("%.3f", c.frequency);;
|
||||
}
|
||||
|
||||
foreach (var c; sort(keys(freqs), string.icmp)) {
|
||||
append(freqarray, {FreqLabel: c, Freq: freqs[c]});
|
||||
}
|
||||
}
|
||||
|
||||
me.freqSelect.setValues(freqarray);
|
||||
|
||||
# Approaches
|
||||
var approachList = apt.getApproachList();
|
||||
me.approachSelect.setValues(approachList);
|
||||
},
|
||||
updateRunwayInfo : func(rwy_info) {
|
||||
if (rwy_info != nil ) {
|
||||
var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width);
|
||||
me.setTextElement("RunwayDimensions", dim);
|
||||
me.setTextElement("RunwaySurface", SURFACE_TYPES[rwy_info.surface]);
|
||||
} else {
|
||||
me.setTextElement("RunwayDimensions", "");
|
||||
me.setTextElement("RunwaySurface", "");
|
||||
}
|
||||
},
|
||||
getSelectedAirportID : func() {
|
||||
return me.airportSelect.getValue();
|
||||
},
|
||||
getSelectedRunway : func() {
|
||||
return me.runwaySelect.getValue();
|
||||
},
|
||||
getSelectedFreq : func() {
|
||||
return me.freqSelect.getValue();
|
||||
},
|
||||
getSelectedApproach : func() {
|
||||
return me.approachSelect.getValue();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,9 +1,210 @@
|
|||
# NearestAirports Controller
|
||||
var NearestAirportsController =
|
||||
{
|
||||
UIGROUP : {
|
||||
NONE : 0, # No group currently selected,
|
||||
APT : 1,
|
||||
RNWY : 2,
|
||||
FREQ : 3,
|
||||
APR : 4,
|
||||
},
|
||||
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestAirportsController ] };
|
||||
|
||||
# Current active UI group.
|
||||
obj.page = page;
|
||||
obj._currentGroup = NearestAirportsController.UIGROUP.NONE;
|
||||
obj._crsrToggle = 0;
|
||||
|
||||
# Emesary
|
||||
obj._recipient = nil;
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
getAirports : func() {
|
||||
# Find the airports within 200nm and display them.
|
||||
|
||||
# To make this more efficient for areas with a high density of airports, we'll try
|
||||
# small radii first.
|
||||
|
||||
var radius = 0;
|
||||
var apts = [];
|
||||
|
||||
while ((radius <= 200) and (size(apts) < 25)) {
|
||||
radius = radius + 50;
|
||||
apts = findAirportsWithinRange(radius);
|
||||
}
|
||||
|
||||
if (size(apts) > 25) {
|
||||
apts = subvec(apts, 0, 25);
|
||||
}
|
||||
me.page.updateAirports(apts);
|
||||
},
|
||||
selectAirports : func() {
|
||||
me.selectGroup(NearestAirportsController.UIGROUP.APT)
|
||||
},
|
||||
selectRunways : func() {
|
||||
me.selectGroup(NearestAirportsController.UIGROUP.RNWY);
|
||||
},
|
||||
selectFrequencies : func() {
|
||||
me.selectGroup(NearestAirportsController.UIGROUP.FREQ);
|
||||
},
|
||||
selectApproaches : func() {
|
||||
me.selectGroup(NearestAirportsController.UIGROUP.APR);
|
||||
},
|
||||
getSelectedGroup : func() {
|
||||
return me._currentGroup;
|
||||
},
|
||||
selectGroup : func(grp) {
|
||||
me._currentGroup = grp;
|
||||
# The current Airport is always highlighted - we're either changing it directly,
|
||||
# or viewing the selected airport.
|
||||
if (grp == NearestAirportsController.UIGROUP.RNWY) me.page.runwaySelect.highlightElement() else me.page.runwaySelect.unhighlightElement();
|
||||
if (grp == NearestAirportsController.UIGROUP.FREQ) me.page.freqSelect.showCRSR() else me.page.freqSelect.hideCRSR();
|
||||
if (grp == NearestAirportsController.UIGROUP.APR) me.page.approachSelect.showCRSR() else me.page.approachSelect.hideCRSR();
|
||||
me._crsrToggle = 1;
|
||||
},
|
||||
|
||||
# Input Handling
|
||||
handleCRSR : func() {
|
||||
me._crsrToggle = (! me._crsrToggle);
|
||||
if (me._crsrToggle) {
|
||||
me.page.selectAirports();
|
||||
me.selectAirports();
|
||||
} else {
|
||||
# Hide the cursor and reset any highlighting
|
||||
me.page.resetCRSR();
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
},
|
||||
handleFMSInner : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
# Scroll through whatever is the current list
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.APT) {
|
||||
me.page.airportSelect.incrSmall(value);
|
||||
var apt_id = me.page.getSelectedAirportID();
|
||||
var apt_info = airportinfo(apt_id);
|
||||
me.page.updateAirportData(apt_info);
|
||||
}
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.RNWY) {
|
||||
me.page.runwaySelect.incrSmall(value);
|
||||
# Need to manually update the runway information
|
||||
var apt_id = me.page.airportSelect.getValue();
|
||||
var rwy = me.page.runwaySelect.getValue();
|
||||
|
||||
if ((rwy != nil) and (rwy != "")) {
|
||||
var apt_info = airportinfo(apt_id);
|
||||
var rwy_info = apt_info.runways[rwy];
|
||||
me.page.updateRunwayInfo(rwy_info);
|
||||
}
|
||||
}
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.FREQ) me.page.freqSelect.incrSmall(value);
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.APR) me.page.approachSelect.incrSmall(value);
|
||||
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return me.page.mfd._pageGroupController.handleFMSInner(value);
|
||||
}
|
||||
},
|
||||
handleFMSOuter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
|
||||
# The large knob only affects the Airport selection in cursor mode.
|
||||
# Question-mark over whether it does this when other groups
|
||||
# are selected. Assumption now is that it doesn't - otherwise it would
|
||||
# be too easy to nudge it while trying to scroll through runways/approaches etc.
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.APT) {
|
||||
me.page.airportSelect.incrLarge(value);
|
||||
var apt_id = me.page.getSelectedAirportID();
|
||||
var apt_info = airportinfo(apt_id);
|
||||
me.page.updateAirportData(apt_info);
|
||||
}
|
||||
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return me.page.mfd._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.APT) {
|
||||
# If the airport group is selected, the ENT key selects the next airport
|
||||
me.page.airportSelect.incrLarge(value);
|
||||
var apt_id = me.page.getSelectedAirportID();
|
||||
var apt_info = airportinfo(apt_id);
|
||||
me.page.updateAirportData(apt_info);
|
||||
}
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.RNWY) {
|
||||
# No effect if runways are selected
|
||||
}
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.FREQ) {
|
||||
# TODO Select the current COM frequency.
|
||||
var freq = me.page.getSelectedFreq();
|
||||
if (freq != nil) print("NearestAirportController.handleEnter frequency selection " ~ freq);
|
||||
}
|
||||
|
||||
if (me._currentGroup == NearestAirportsController.UIGROUP.APR) {
|
||||
# TODO Select the current Approach
|
||||
var appr = me.page.getSelectedApproach();
|
||||
if (appr != nil) print("NearestAirportController.handleEnter Approach selection " ~ appr);
|
||||
}
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me.page.device.designation);
|
||||
var pfd_obj = me.page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me._currentGroup = NearestAirportsController.UIGROUP.NONE;
|
||||
me.RegisterWithEmesary();
|
||||
me.getAirports();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var NearestAirspaces =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST AIRSPACES",
|
||||
_group : myCanvas.createGroup("NearestAirspacesLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestAirspaces", "NearestAirspacesGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestAirspaces,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestAirspaces", "NRST - NEAREST AIRSPACES")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestAirspacesStyles.new();
|
||||
obj.Options = fg1000.NearestAirspacesOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestAirspacesController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NearestAirspaces =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NearestAirspacesController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NearestAirspaces =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NearestAirspacesController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestAirspacesController ] };
|
||||
var obj = {
|
||||
parents : [ NearestAirspacesController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var NearestFrequencies =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST FREQUENCIES",
|
||||
_group : myCanvas.createGroup("NearestFrequenciesLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestFrequencies", "NearestFrequenciesGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestFrequencies,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestFrequencies", "NRST - NEAREST FREQUENCIES")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestFrequenciesStyles.new();
|
||||
obj.Options = fg1000.NearestFrequenciesOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestFrequenciesController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NearestFrequencies =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NearestFrequenciesController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NearestFrequencies =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NearestFrequenciesController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestFrequenciesController ] };
|
||||
var obj = {
|
||||
parents : [ NearestFrequenciesController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var NearestIntersections =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST INTERSECTIONS",
|
||||
_group : myCanvas.createGroup("NearestIntersectionsLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestIntersections", "NearestIntersectionsGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestIntersections,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestIntersections", "NRST - NEAREST INTERSECTIONS")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestIntersectionsStyles.new();
|
||||
obj.Options = fg1000.NearestIntersectionsOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestIntersectionsController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NearestIntersections =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NearestIntersectionsController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NearestIntersections =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NearestIntersectionsController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestIntersectionsController ] };
|
||||
var obj = {
|
||||
parents : [ NearestIntersectionsController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var NearestNDB =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST NDB",
|
||||
_group : myCanvas.createGroup("NearestNDBLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestNDB", "NearestNDBGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestNDB,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestNDB", "NRST - NEAREST NDB")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestNDBStyles.new();
|
||||
obj.Options = fg1000.NearestNDBOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestNDBController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NearestNDB =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NearestNDBController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NearestNDB =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NearestNDBController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestNDBController ] };
|
||||
var obj = {
|
||||
parents : [ NearestNDBController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var NearestUserWPT =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST USER WPTS",
|
||||
_group : myCanvas.createGroup("NearestUserWPTLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestUserWPT", "NearestUserWPTGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestUserWPT,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestUserWPT", "NRST - NEAREST USER WPTS")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestUserWPTStyles.new();
|
||||
obj.Options = fg1000.NearestUserWPTOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestUserWPTController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NearestUserWPT =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NearestUserWPTController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NearestUserWPT =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NearestUserWPTController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestUserWPTController ] };
|
||||
var obj = {
|
||||
parents : [ NearestUserWPTController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var NearestVOR =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "NRST - NEAREST VOR",
|
||||
_group : myCanvas.createGroup("NearestVORLayer"),
|
||||
parents : [ NavMap, device.addPage("NearestVOR", "NearestVORGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
NearestVOR,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "NearestVOR", "NRST - NEAREST VOR")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.NearestVORStyles.new();
|
||||
obj.Options = fg1000.NearestVOROptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.NearestVORController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var NearestVOR =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.NearestVORController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var NearestVOR =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var NearestVORController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ NearestVORController ] };
|
||||
var obj = {
|
||||
parents : [ NearestVORController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ var PAGE_GROUPS = [
|
|||
|
||||
{ label: "MapPageGroupLabel",
|
||||
group: "MapPageGroup",
|
||||
pages: [ "NavMap", "TrafficMap", "Stormscope", "WeatherDataLink", "TAWSB"],
|
||||
pages: [ "NavigationMap", "TrafficMap", "Stormscope", "WeatherDataLink", "TAWSB"],
|
||||
},
|
||||
{ label: "WPTGroupLabel",
|
||||
group: "WPTPageGroup",
|
||||
|
@ -48,6 +48,22 @@ var PageGroupController =
|
|||
|
||||
# List of pages to be controllers. Keys are the pages in PAGE_GROUPS;
|
||||
obj._pageList = {};
|
||||
obj._elements = {};
|
||||
|
||||
foreach (var pageGroup; PAGE_GROUPS) {
|
||||
var group = svg.getElementById(pageGroup.group);
|
||||
var label = svg.getElementById(pageGroup.label);
|
||||
assert(group != nil, "Unable to find element " ~ pageGroup.group);
|
||||
assert(label != nil, "Unable to find element " ~ pageGroup.label);
|
||||
obj._elements[pageGroup.group] = group;
|
||||
obj._elements[pageGroup.label] = label;
|
||||
|
||||
foreach(var pg; pageGroup.pages) {
|
||||
var page = svg.getElementById(pg);
|
||||
assert(page != nil, "Unable to find element " ~ pg);
|
||||
obj._elements[pg] = page;
|
||||
}
|
||||
}
|
||||
|
||||
# Timers to control when to hide the menu after inactivity, and when to load
|
||||
# a new page.
|
||||
|
@ -75,8 +91,8 @@ var PageGroupController =
|
|||
{
|
||||
foreach(var pageGroup; PAGE_GROUPS)
|
||||
{
|
||||
me._svg.getElementById(pageGroup.group).setVisible(0);
|
||||
me._svg.getElementById(pageGroup.label).setVisible(0);
|
||||
me._elements[pageGroup.group].setVisible(0);
|
||||
me._elements[pageGroup.label].setVisible(0);
|
||||
}
|
||||
me._menuVisible = 0;
|
||||
},
|
||||
|
@ -87,13 +103,9 @@ var PageGroupController =
|
|||
var pageToLoad = PAGE_GROUPS[me._selectedPageGroup].pages[me._selectedPage];
|
||||
var page = me._pageList[pageToLoad];
|
||||
|
||||
if (page != nil) {
|
||||
me._device.selectPage(page);
|
||||
} else {
|
||||
printf("Unable to find page " ~ pageToLoad);
|
||||
}
|
||||
assert(page != nil, "Unable to find page " ~ pageToLoad);
|
||||
me._device.selectPage(page);
|
||||
},
|
||||
|
||||
showMenu : func()
|
||||
{
|
||||
foreach(var pageGroup; PAGE_GROUPS)
|
||||
|
@ -101,26 +113,26 @@ var PageGroupController =
|
|||
if (PAGE_GROUPS[me._selectedPageGroup].label == pageGroup.label)
|
||||
{
|
||||
# Display the page group and highlight the label
|
||||
me._svg.getElementById(pageGroup.group).setVisible(1);
|
||||
me._svg.getElementById(pageGroup.label).setVisible(1);
|
||||
me._svg.getElementById(pageGroup.label).setColor(0.7,0.7,1.0);
|
||||
me._elements[pageGroup.group].setVisible(1);
|
||||
me._elements[pageGroup.label].setVisible(1);
|
||||
me._elements[pageGroup.label].setColor(0.7,0.7,1.0);
|
||||
|
||||
foreach (var page; pageGroup.pages)
|
||||
{
|
||||
# Highlight the current page.
|
||||
if (pageGroup.pages[me._selectedPage] == page) {
|
||||
me._svg.getElementById(page).setColor(0.7,0.7,1.0);
|
||||
me._elements[page].setColor(0.7,0.7,1.0);
|
||||
} else {
|
||||
me._svg.getElementById(page).setColor(0.7,0.7,0.7);
|
||||
me._elements[page].setColor(0.7,0.7,0.7);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# Hide the pagegroup and unhighlight the label on the bottom
|
||||
me._svg.getElementById(pageGroup.group).setVisible(0);
|
||||
me._svg.getElementById(pageGroup.label).setVisible(1);
|
||||
me._svg.getElementById(pageGroup.label).setColor(0.7,0.7,0.7);
|
||||
me._elements[pageGroup.group].setVisible(0);
|
||||
me._elements[pageGroup.label].setVisible(1);
|
||||
me._elements[pageGroup.label].setColor(0.7,0.7,0.7);
|
||||
}
|
||||
}
|
||||
me._menuVisible = 1;
|
||||
|
|
|
@ -4,28 +4,12 @@ var StoredFlightPlan =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "FPL - STORED FLIGHT PLAN",
|
||||
_group : myCanvas.createGroup("StoredFlightPlanLayer"),
|
||||
parents : [ NavMap, device.addPage("StoredFlightPlan", "StoredFlightPlanGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
StoredFlightPlan,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "StoredFlightPlan", "FPL - STORED FLIGHT PLAN")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.StoredFlightPlanStyles.new();
|
||||
obj.Options = fg1000.StoredFlightPlanOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.StoredFlightPlanController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var StoredFlightPlan =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.StoredFlightPlanController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var StoredFlightPlan =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var StoredFlightPlanController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ StoredFlightPlanController ] };
|
||||
var obj = {
|
||||
parents : [ StoredFlightPlanController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Stormscope =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "MAP - STORMSCOPE",
|
||||
_group : myCanvas.createGroup("StormscopeLayer"),
|
||||
parents : [ NavMap, device.addPage("Stormscope", "StormscopeGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Stormscope,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Stormscope", "MAP - STORMSCOPE")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.StormscopeStyles.new();
|
||||
obj.Options = fg1000.StormscopeOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.StormscopeController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Stormscope =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.StormscopeController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Stormscope =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var StormscopeController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ StormscopeController ] };
|
||||
var obj = {
|
||||
parents : [ StormscopeController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var SystemStatus =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "AUX - SYSTEM STATUS",
|
||||
_group : myCanvas.createGroup("SystemStatusLayer"),
|
||||
parents : [ NavMap, device.addPage("SystemStatus", "SystemStatusGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
SystemStatus,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "SystemStatus", "AUX - SYSTEM STATUS")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.SystemStatusStyles.new();
|
||||
obj.Options = fg1000.SystemStatusOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.SystemStatusController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var SystemStatus =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.SystemStatusController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var SystemStatus =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var SystemStatusController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ SystemStatusController ] };
|
||||
var obj = {
|
||||
parents : [ SystemStatusController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var TAWS =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "MAP - TAWS",
|
||||
_group : myCanvas.createGroup("TAWSLayer"),
|
||||
parents : [ NavMap, device.addPage("TAWS", "TAWSGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
TAWS,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "TAWS", "MAP - TAWS")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.TAWSStyles.new();
|
||||
obj.Options = fg1000.TAWSOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.TAWSController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var TAWS =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.TAWSController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var TAWS =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var TAWSController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ TAWSController ] };
|
||||
var obj = {
|
||||
parents : [ TAWSController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var TemplateController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ TemplateController ] };
|
||||
var obj = {
|
||||
parents : [ TemplateController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,29 +4,12 @@ var Template =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "TemplateTitle",
|
||||
_group : myCanvas.createGroup("TemplateLayer"),
|
||||
parents : [ Template, device.addPage("Template", "TemplateGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Template,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Template", "TemplateTitle")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.TemplateStyles.new();
|
||||
obj.Options = fg1000.TemplateOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.TemplateController.new(obj, svg);
|
||||
|
||||
# Dynamic text elements in the SVG file. In the SVG these have an "AirportInfo" prefix.
|
||||
var textelements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
obj.symbols[element].setText("");
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -59,6 +42,8 @@ var Template =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.TemplateController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -71,9 +56,11 @@ var Template =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -7,16 +7,10 @@ var TrafficMap =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "MAP - TRAFFIC MAP",
|
||||
_group : myCanvas.createGroup("TrafficMapLayer"),
|
||||
parents : [ TrafficMap, device.addPage("TrafficMap", "TrafficMapGroup") ]
|
||||
parents : [ TrafficMap, MFDPage.new(mfd, myCanvas, device, svg, "TrafficMap", "MAP - TRAFFIC MAP") ]
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.TrafficMapStyles.new();
|
||||
obj.Options = fg1000.TrafficMapOptions.new();
|
||||
obj.mapgroup = obj._group.createChild("map");
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
# Dynamic text elements
|
||||
obj.op_label = svg.getElementById("TrafficMapOpMode");
|
||||
|
@ -24,10 +18,6 @@ var TrafficMap =
|
|||
obj.outer_label = svg.getElementById("TrafficMapOuterRange");
|
||||
obj.inner_label = svg.getElementById("TrafficMapInnerRange");
|
||||
|
||||
# Need to display this underneath the softkeys, EIS, header.
|
||||
obj._group.set("z-index", -10.0);
|
||||
obj._group.setVisible(0);
|
||||
|
||||
# Initialize the controller:
|
||||
var ctrl_ns = canvas.Map.Controller.get("Aircraft position");
|
||||
var source = ctrl_ns.SOURCES["current-pos"];
|
||||
|
|
|
@ -121,9 +121,9 @@ var TrafficMapController =
|
|||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.MFD.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.MFD.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.MFD.FASCIA.RANGE) return controller.zoom(value);
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.RANGE) return controller.zoom(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
|
|
|
@ -4,28 +4,12 @@ var TripPlanning =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "AUX - TRIP PLANNING",
|
||||
_group : myCanvas.createGroup("TripPlanningLayer"),
|
||||
parents : [ NavMap, device.addPage("TripPlanning", "TripPlanningGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
TripPlanning,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "TripPlanning", "AUX - TRIP PLANNING")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.TripPlanningStyles.new();
|
||||
obj.Options = fg1000.TripPlanningOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.TripPlanningController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var TripPlanning =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.TripPlanningController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var TripPlanning =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var TripPlanningController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ TripPlanningController ] };
|
||||
var obj = {
|
||||
parents : [ TripPlanningController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var UserWPTInfo =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - USER WPT INFORMATION",
|
||||
_group : myCanvas.createGroup("UserWPTInfoLayer"),
|
||||
parents : [ NavMap, device.addPage("UserWPTInfo", "UserWPTInfoGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
UserWPTInfo,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "UserWPTInfo", "WPT - USER WPT INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.UserWPTInfoStyles.new();
|
||||
obj.Options = fg1000.UserWPTInfoOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.UserWPTInfoController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var UserWPTInfo =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.UserWPTInfoController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var UserWPTInfo =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var UserWPTInfoController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ UserWPTInfoController ] };
|
||||
var obj = {
|
||||
parents : [ UserWPTInfoController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var Utility =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "AUX - UTILITY",
|
||||
_group : myCanvas.createGroup("UtilityLayer"),
|
||||
parents : [ NavMap, device.addPage("Utility", "UtilityGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
Utility,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "Utility", "AUX - UTILITY")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.UtilityStyles.new();
|
||||
obj.Options = fg1000.UtilityOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.UtilityController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var Utility =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.UtilityController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var Utility =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var UtilityController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ UtilityController ] };
|
||||
var obj = {
|
||||
parents : [ UtilityController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var VORInfo =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "WPT - VOR INFORMATION",
|
||||
_group : myCanvas.createGroup("VORInfoLayer"),
|
||||
parents : [ NavMap, device.addPage("VORInfo", "VORInfoGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
VORInfo,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "VORInfo", "WPT - VOR INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.VORInfoStyles.new();
|
||||
obj.Options = fg1000.VORInfoOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.VORInfoController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var VORInfo =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.VORInfoController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var VORInfo =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var VORInfoController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ VORInfoController ] };
|
||||
var obj = {
|
||||
parents : [ VORInfoController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var WeatherDataLink =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "MAP - WEATHER DATA LINK",
|
||||
_group : myCanvas.createGroup("WeatherDataLinkLayer"),
|
||||
parents : [ NavMap, device.addPage("WeatherDataLink", "WeatherDataLinkGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
WeatherDataLink,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "WeatherDataLink", "MAP - WEATHER DATA LINK")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.WeatherDataLinkStyles.new();
|
||||
obj.Options = fg1000.WeatherDataLinkOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.WeatherDataLinkController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var WeatherDataLink =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.WeatherDataLinkController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var WeatherDataLink =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var WeatherDataLinkController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ WeatherDataLinkController ] };
|
||||
var obj = {
|
||||
parents : [ WeatherDataLinkController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var XMInfo =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "AUX - XM INFORMATION",
|
||||
_group : myCanvas.createGroup("XMInfoLayer"),
|
||||
parents : [ NavMap, device.addPage("XMInfo", "XMInfoGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
XMInfo,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "XMInfo", "AUX - XM INFORMATION")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.XMInfoStyles.new();
|
||||
obj.Options = fg1000.XMInfoOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.XMInfoController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var XMInfo =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.XMInfoController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var XMInfo =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var XMInfoController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ XMInfoController ] };
|
||||
var obj = {
|
||||
parents : [ XMInfoController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -4,28 +4,12 @@ var XMRadio =
|
|||
new : func (mfd, myCanvas, device, svg)
|
||||
{
|
||||
var obj = {
|
||||
title : "AUX - XM RADIO",
|
||||
_group : myCanvas.createGroup("XMRadioLayer"),
|
||||
parents : [ NavMap, device.addPage("XMRadio", "XMRadioGroup") ],
|
||||
symbols : {},
|
||||
parents : [
|
||||
XMRadio,
|
||||
MFDPage.new(mfd, myCanvas, device, svg, "XMRadio", "AUX - XM RADIO")
|
||||
],
|
||||
};
|
||||
|
||||
obj.Styles = fg1000.XMRadioStyles.new();
|
||||
obj.Options = fg1000.XMRadioOptions.new();
|
||||
obj.device = device;
|
||||
obj.mfd = mfd;
|
||||
|
||||
obj.controller = fg1000.XMRadioController.new(obj, svg);
|
||||
|
||||
# Dynamic elements
|
||||
var elements = [
|
||||
|
||||
];
|
||||
|
||||
foreach (var element; elements) {
|
||||
obj.symbols[element] = svg.getElementById(element);
|
||||
}
|
||||
|
||||
var topMenu = func(device, pg, menuitem) {
|
||||
pg.clearMenu();
|
||||
resetMenuColors(device);
|
||||
|
@ -58,6 +42,8 @@ var XMRadio =
|
|||
|
||||
topMenu(device, obj, nil);
|
||||
|
||||
obj.controller = fg1000.XMRadioController.new(obj, svg);
|
||||
|
||||
return obj;
|
||||
},
|
||||
offdisplay : func() {
|
||||
|
@ -70,9 +56,11 @@ var XMRadio =
|
|||
me.device.svg.getElementById(name ~ "-bg").setColorFill(0.0,0.0,0.0);
|
||||
me.device.svg.getElementById(name).setColor(1.0,1.0,1.0);
|
||||
}
|
||||
me.controller.offdisplay();
|
||||
},
|
||||
ondisplay : func() {
|
||||
me._group.setVisible(1);
|
||||
me.mfd.setPageTitle(me.title);
|
||||
me.controller.ondisplay();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -3,7 +3,93 @@ var XMRadioController =
|
|||
{
|
||||
new : func (page, svg)
|
||||
{
|
||||
var obj = { parents : [ XMRadioController ] };
|
||||
var obj = {
|
||||
parents : [ XMRadioController ],
|
||||
_crsrToggle : 0,
|
||||
_recipient : nil,
|
||||
_page : page,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
||||
# 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._pageGroupController.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._pageGroupController.handleFMSOuter(value);
|
||||
}
|
||||
},
|
||||
handleEnter : func(value) {
|
||||
if (me._crsrToggle == 1) {
|
||||
return emesary.Transmitter.ReceiptStatus_Finished;
|
||||
} else {
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
}
|
||||
},
|
||||
RegisterWithEmesary : func(transmitter = nil){
|
||||
if (transmitter == nil)
|
||||
transmitter = emesary.GlobalTransmitter;
|
||||
|
||||
if (me._recipient == nil){
|
||||
me._recipient = emesary.Recipient.new("AirportInfoController_" ~ me._page.device.designation);
|
||||
var pfd_obj = me._page.device;
|
||||
var controller = me;
|
||||
me._recipient.Receive = func(notification)
|
||||
{
|
||||
if (notification.Device_Id == pfd_obj.device_id
|
||||
and notification.NotificationType == notifications.PFDEventNotification.DefaultType) {
|
||||
if (notification.Event_Id == notifications.PFDEventNotification.HardKeyPushed
|
||||
and notification.EventParameter != nil)
|
||||
{
|
||||
var id = notification.EventParameter.Id;
|
||||
var value = notification.EventParameter.Value;
|
||||
#printf("Button pressed " ~ id ~ " " ~ value);
|
||||
if (id == fg1000.FASCIA.FMS_CRSR) return controller.handleCRSR();
|
||||
if (id == fg1000.FASCIA.FMS_OUTER) return controller.handleFMSOuter(value);
|
||||
if (id == fg1000.FASCIA.FMS_INNER) return controller.handleFMSInner(value);
|
||||
if (id == fg1000.FASCIA.ENT) return controller.handleEnter(value);
|
||||
}
|
||||
}
|
||||
return emesary.Transmitter.ReceiptStatus_NotProcessed;
|
||||
};
|
||||
}
|
||||
transmitter.Register(me._recipient);
|
||||
me.transmitter = transmitter;
|
||||
},
|
||||
DeRegisterWithEmesary : func(transmitter = nil){
|
||||
# remove registration from transmitter; but keep the recipient once it is created.
|
||||
if (me.transmitter != nil)
|
||||
me.transmitter.DeRegister(me._recipient);
|
||||
me.transmitter = nil;
|
||||
},
|
||||
|
||||
# Reset controller if required when the page is displayed or hidden
|
||||
ondisplay : func() {
|
||||
me.RegisterWithEmesary();
|
||||
},
|
||||
offdisplay : func() {
|
||||
me.DeRegisterWithEmesary();
|
||||
},
|
||||
|
||||
};
|
||||
|
|
116
Aircraft/Instruments-3d/FG1000/Nasal/constants.nas
Normal file
|
@ -0,0 +1,116 @@
|
|||
# Constants to define the display area, for placement of elements. We
|
||||
# could try to do something with a layout, but the position and size of
|
||||
# elements is fixed. Can't be member variables of MFD as they are
|
||||
# self-referential.
|
||||
|
||||
var DISPLAY = { WIDTH : 1024, HEIGHT : 768 };
|
||||
var HEADER_HEIGHT = 56;
|
||||
var FOOTER_HEIGHT = 25;
|
||||
var EIS_WIDTH = 150;
|
||||
|
||||
# Size of data display on the right hand side of the MFD
|
||||
var DATA_DISPLAY = {
|
||||
WIDTH : 300,
|
||||
HEIGHT : DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT,
|
||||
X : DISPLAY.WIDTH - 300,
|
||||
Y : HEADER_HEIGHT,
|
||||
};
|
||||
|
||||
# Map dimensions when the data display is not present
|
||||
var MAP_FULL = {
|
||||
CENTER : { X : ((DISPLAY.WIDTH - EIS_WIDTH) / 2 + EIS_WIDTH),
|
||||
Y : ((DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT) / 2 + HEADER_HEIGHT), },
|
||||
X : EIS_WIDTH,
|
||||
Y : HEADER_HEIGHT,
|
||||
WIDTH : DISPLAY.WIDTH - EIS_WIDTH,
|
||||
HEIGHT : DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT,
|
||||
};
|
||||
|
||||
# Map dimensions when the data display is present
|
||||
var MAP_PARTIAL = {
|
||||
X : EIS_WIDTH,
|
||||
Y : HEADER_HEIGHT,
|
||||
WIDTH : DISPLAY.WIDTH - EIS_WIDTH - DATA_DISPLAY.WIDTH,
|
||||
HEIGHT : DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT,
|
||||
CENTER : { X : ((DISPLAY.WIDTH - EIS_WIDTH - DATA_DISPLAY.WIDTH) / 2 + EIS_WIDTH),
|
||||
Y : ((DISPLAY.HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT) / 2 + HEADER_HEIGHT), },
|
||||
};
|
||||
|
||||
# When the CRSR is selecting fields, this is the period for changing the
|
||||
# cursor color between normal and highlight (defined below)
|
||||
# Constants for the hard-buttons on the fascia
|
||||
FASCIA = {
|
||||
NAV_VOL : 0,
|
||||
NAV_VOL_TOGGLE : 1,
|
||||
NAV_FREQ_TRANSFER :2,
|
||||
NAV_OUTER : 3,
|
||||
NAV_INNER : 4,
|
||||
NAV_TOGGLE : 5,
|
||||
HEADING : 6,
|
||||
HEADING_PRESS : 7,
|
||||
|
||||
# Joystick
|
||||
RANGE : 8,
|
||||
JOYSTICK_HORIZONTAL : 9,
|
||||
JOYSTICK_VERTICAL : 10,
|
||||
|
||||
#CRS/BARO
|
||||
BARO : 11,
|
||||
CRS : 12,
|
||||
CRS_CENTER : 13,
|
||||
|
||||
COM_OUTER : 14,
|
||||
COM_INNER : 15,
|
||||
COM_TOGGLE : 16,
|
||||
|
||||
COM_FREQ_TRANSFER : 17,
|
||||
COM_FREQ_TRANSFER_HOLD :18, # Auto-tunes to 121.2 when pressed for 2 seconds
|
||||
|
||||
COM_VOL: 19,
|
||||
COM_VOL_TOGGLE: 20,
|
||||
|
||||
DTO : 21,
|
||||
FPL : 22,
|
||||
CLR : 23,
|
||||
CLR_HOLD: 24, # Holding the CLR button for 2 seconds on the MFD displays the Nav Map
|
||||
|
||||
FMS_OUTER : 25,
|
||||
FMS_INNER : 26,
|
||||
FMS_CRSR : 27,
|
||||
|
||||
MENU : 28,
|
||||
PROC : 29,
|
||||
ENT : 30,
|
||||
|
||||
ALT_OUTER : 31,
|
||||
ALT_INNER : 32,
|
||||
|
||||
# Autopilot controls
|
||||
AP : 33,
|
||||
HDG : 34,
|
||||
NAV : 35,
|
||||
APR : 36,
|
||||
VS : 37,
|
||||
FLC : 38,
|
||||
FD : 39,
|
||||
ALT : 40,
|
||||
VNV : 41,
|
||||
BC : 42,
|
||||
NOSE_UP : 43,
|
||||
NOSE_DOWN : 44,
|
||||
|
||||
};
|
||||
|
||||
var SURFACE_TYPES = {
|
||||
1 : "HARD SURFACE", # Asphalt
|
||||
2 : "HARD SURFACE", # Concrete
|
||||
3 : "TURF",
|
||||
4 : "DIRT",
|
||||
5 : "GRAVEL",
|
||||
# Helipads
|
||||
6 : "HARD SURFACE", # Asphalt
|
||||
7 : "HARD SURFACE", # Concrete
|
||||
8 : "TURF",
|
||||
9 : "DIRT",
|
||||
0 : "GRAVEL",
|
||||
};
|
|
@ -5,7 +5,7 @@ use warnings;
|
|||
my %pages = ("Stormscope" => "MAP - STORMSCOPE",
|
||||
"WeatherDataLink" => "MAP - WEATHER DATA LINK",
|
||||
"TAWS" => "MAP - TAWS",
|
||||
"AirportInfo" => "WPT - AIRPORT INFORMATION",
|
||||
#"AirportInfo" => "WPT - AIRPORT INFORMATION",
|
||||
"AirportDirectory" => "WPT - AIRPORT DIRECTORY",
|
||||
"AirportDeparture" => "WPT - AIRPORT DEPARTURE INFORMATION",
|
||||
"AirportArrival" => "WPT - AIRPORT ARRIVAL INFORMATION",
|
||||
|
@ -30,7 +30,7 @@ my %pages = ("Stormscope" => "MAP - STORMSCOPE",
|
|||
"Checklist3" => "LST - CHECKLIST 3",
|
||||
"Checklist4" => "LST - CHECKLIST 4",
|
||||
"Checklist5" => "LST - CHECKLIST 5",
|
||||
"NearestAirports" => "NRST - NEAREST AIRPORTS",
|
||||
#"NearestAirports" => "NRST - NEAREST AIRPORTS",
|
||||
"NearestIntersections" => "NRST - NEAREST INTERSECTIONS",
|
||||
"NearestNDB" => "NRST - NEAREST NDB",
|
||||
"NearestVOR" => "NRST - NEAREST VOR",
|
||||
|
|
41
Nasal/canvas/PFD/ArrowElement.nas
Normal file
|
@ -0,0 +1,41 @@
|
|||
# PFD UI Element - Arrow UI Element. Can have values set and retrieved
|
||||
# and has a separate arrow icon to indicate selection
|
||||
var ArrowElement =
|
||||
{
|
||||
new : func (pagename, svg, name, value, style=nil)
|
||||
{
|
||||
var obj = {
|
||||
parents : [ ArrowElement, PFD.UIElement ],
|
||||
_name : pagename ~ name,
|
||||
_value : value,
|
||||
_style : style,
|
||||
};
|
||||
|
||||
if (style == nil) obj._style = PFD.DefaultStyle;
|
||||
|
||||
obj._symbol = svg.getElementById(obj._name);
|
||||
assert(obj._symbol != nil, "Unable to find element " ~ obj._name);
|
||||
|
||||
obj.unhighlightElement();
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
getName : func() { return me._name; },
|
||||
getValue : func() { return me._value; },
|
||||
setValue : func(value) { me._value = value; },
|
||||
setVisible : func(vis) { me._symbol.setVisible(vis); },
|
||||
highlightElement : func() {
|
||||
me._symbol.setVisible(1);
|
||||
},
|
||||
unhighlightElement : func() {
|
||||
me._symbol.setVisible(0);
|
||||
},
|
||||
isEditable : func () { return 0; },
|
||||
isInEdit : func() { return 0; },
|
||||
enterElement : func() { return me.getValue(); },
|
||||
clearElement : func() { },
|
||||
editElement : func() { },
|
||||
incrSmall : func(value) { },
|
||||
incrLarge : func(value) { },
|
||||
};
|
200
Nasal/canvas/PFD/DataEntryElement.nas
Normal file
|
@ -0,0 +1,200 @@
|
|||
# PFD DataEntryElement - Data Entry UI Element.
|
||||
#
|
||||
# Uses the FMS Knobs to enter a text value with a given length and character set.
|
||||
#
|
||||
# To use, there must be an element called [PageName][ElementName] which will
|
||||
# be used for the complete string, and a set of [PageName][ElementName]{0...n}
|
||||
# elements, each consisting of a single character for input.
|
||||
#
|
||||
var DataEntryElement =
|
||||
{
|
||||
new : func (pagename, svg, name, value, size, charSet, style=nil)
|
||||
{
|
||||
var obj = {
|
||||
parents : [ DataEntryElement, PFD.UIElement ],
|
||||
_name : pagename ~ name,
|
||||
_size : size,
|
||||
_charSet : charSet,
|
||||
_dataEntryPos : -1,
|
||||
_dataEntrySymbol : [],
|
||||
_style : style,
|
||||
};
|
||||
|
||||
if (style == nil) obj._style = PFD.DefaultStyle;
|
||||
|
||||
obj._symbol = svg.getElementById(obj._name);
|
||||
assert(obj._symbol != nil, "Unable to find element" ~ obj._name);
|
||||
obj.setValue(value);
|
||||
|
||||
for (var i = 0; i < size; i = i + 1) {
|
||||
var nodeName = obj._name ~ i;
|
||||
append(obj._dataEntrySymbol, svg.getElementById(nodeName));
|
||||
assert(obj._dataEntrySymbol[i] != nil, "Unable to find element " ~ nodeName);
|
||||
obj._dataEntrySymbol[i].setVisible(0);
|
||||
}
|
||||
|
||||
# State and timer for flashing highlighting of elements
|
||||
obj._highlighted = 0;
|
||||
obj._highlightedChar = 0;
|
||||
obj._flashTimer = nil;
|
||||
obj._flashCharTimer = nil;
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
getName : func() { return me._name; },
|
||||
getValue : func() { return me._symbol.getText(); },
|
||||
setValue : func(value) { me._symbol.setText(value); },
|
||||
setVisible : func(vis) {
|
||||
me._symbol.setVisible(vis);
|
||||
|
||||
# Only ever hide the character entry symbols, as they are displayed
|
||||
# only when editing
|
||||
if (vis == 0) {
|
||||
for (var i = 0; i < me._size; i = i + 1) me._dataEntrySymbol[i].setVisible(0);
|
||||
}
|
||||
},
|
||||
_flashElement : func() {
|
||||
if (me._highlighted == 0) {
|
||||
me._symbol.setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX);
|
||||
me._symbol.setColorFill(me._style.HIGHLIGHT_COLOR);
|
||||
me._symbol.setColor(me._style.HIGHLIGHT_TEXT_COLOR);
|
||||
me._highlighted = 1;
|
||||
} else {
|
||||
me._symbol.setDrawMode(canvas.Text.TEXT);
|
||||
me._symbol.setColor(me._style.NORMAL_TEXT_COLOR);
|
||||
me._highlighted = 0;
|
||||
}
|
||||
},
|
||||
highlightElement : func() {
|
||||
me._flashElement();
|
||||
me._flashTimer = maketimer(me._style.CURSOR_BLINK_PERIOD, me, me._flashElement);
|
||||
me._flashTimer.start();
|
||||
},
|
||||
unhighlightElement : func() {
|
||||
if (me._flashTimer != nil) me._flashTimer.stop();
|
||||
me._flashTimer = nil;
|
||||
|
||||
# Reset the highlight to a non-highlighted state.
|
||||
me._highlighted = 1;
|
||||
me._flashElement();
|
||||
},
|
||||
|
||||
_flashCharElement : func() {
|
||||
if (me._highlighted == 0) {
|
||||
me._dataEntrySymbol[me._dataEntryPos].setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX);
|
||||
me._dataEntrySymbol[me._dataEntryPos].setColorFill(me._style.HIGHLIGHT_COLOR);
|
||||
me._dataEntrySymbol[me._dataEntryPos].setColor(me._style.HIGHLIGHT_TEXT_COLOR);
|
||||
me._highlightedChar = 1;
|
||||
} else {
|
||||
me._dataEntrySymbol[me._dataEntryPos].setDrawMode(canvas.Text.TEXT);
|
||||
me._dataEntrySymbol[me._dataEntryPos].setColor(me._style.NORMAL_TEXT_COLOR);
|
||||
me._highlightedChar = 0;
|
||||
}
|
||||
},
|
||||
highlightCharElement : func() {
|
||||
me._flashCharElement();
|
||||
me._flashCharTimer = maketimer(me._style.CURSOR_BLINK_PERIOD, me, me._flashCharElement);
|
||||
me._flashCharTimer.start();
|
||||
},
|
||||
unhighlightCharElement : func() {
|
||||
if (me._flashCharTimer != nil) me._flashCharTimer.stop();
|
||||
me._flashCharTimer = nil;
|
||||
|
||||
# Reset the highlight to a non-highlighted state.
|
||||
me._highlightedChar = 1;
|
||||
me._flashCharElement();
|
||||
},
|
||||
isEditable : func () { return 1; },
|
||||
isInEdit : func() { return (me._dataEntryPos != -1); },
|
||||
|
||||
enterElement : func() {
|
||||
# Handle pressing enter to confirm this element.
|
||||
# - Hiding the per-character entry fields
|
||||
# - concatenating the data that's been entered into a string
|
||||
# - displaying the string in the (highlighted) top level element
|
||||
#
|
||||
# Also pass back the string to the caller.
|
||||
|
||||
var val = "";
|
||||
|
||||
for (var i = 0; i < me._size; i = i + 1) {
|
||||
if (me._dataEntrySymbol[i].getText() != "_") {
|
||||
val = val ~ me._dataEntrySymbol[i].getText();
|
||||
}
|
||||
me._dataEntrySymbol[i].setVisible(0);
|
||||
}
|
||||
|
||||
me._symbol.setText(val);
|
||||
me._symbol.setVisible(1);
|
||||
me.highlightElement();
|
||||
me._dataEntryPos = -1;
|
||||
return val;
|
||||
},
|
||||
clearElement : func() {
|
||||
# Cancel editing this element by
|
||||
# - Hiding the per-character entry fields
|
||||
# - Highlighting the top level element
|
||||
|
||||
for (var i = 0; i < me._size; i = i + 1) {
|
||||
me._dataEntrySymbol[i].setVisible(0);
|
||||
}
|
||||
|
||||
me._symbol.setVisible(1);
|
||||
me.highlightElement();
|
||||
me._dataEntryPos = -1;
|
||||
},
|
||||
incrSmall : func(value) {
|
||||
# Change the value of this element, or start editing it if we're not already
|
||||
# doing so.
|
||||
|
||||
if (me._dataEntryPos == -1) {
|
||||
# Start editing by hiding the top level element, and displaying and
|
||||
# resetting the character entry fields.
|
||||
me._dataEntryPos = 0;
|
||||
|
||||
me._symbol.setVisible(0);
|
||||
|
||||
for (var i = 0; i < me._size; i = i + 1) {
|
||||
me._dataEntrySymbol[i].setText("_");
|
||||
me._dataEntrySymbol[i].setVisible(1);
|
||||
}
|
||||
|
||||
# Highlight the first character element to indicate we're editing it
|
||||
me.highlightCharElement();
|
||||
} else {
|
||||
var charSym = me._dataEntrySymbol[me._dataEntryPos];
|
||||
var incr_or_decr = (value > 0) ? 1 : -1;
|
||||
|
||||
# Change the value of the data element
|
||||
var val = charSym.getText();
|
||||
|
||||
if (val == "_") {
|
||||
# Not previously set, so set to the first or last characterset entry
|
||||
# depending on direction
|
||||
if (incr_or_decr > 0) {
|
||||
charSym.setText(chr(me._charSet[0]));
|
||||
} else {
|
||||
charSym.setText(chr(me._charSet[size(me._charSet) -1]));
|
||||
}
|
||||
} else {
|
||||
var curIdx = find(val, me._charSet);
|
||||
|
||||
if (curIdx == -1) die("Failed to find character " ~ val ~ " in dataEntryElement " ~ element);
|
||||
curIdx = math.mod(curIdx + incr_or_decr, size(me._charSet));
|
||||
charSym.setText(chr(me._charSet[curIdx]));
|
||||
}
|
||||
}
|
||||
},
|
||||
incrLarge : func(value) {
|
||||
# Change the cursor position within a data element
|
||||
var incr_or_decr = (value > 0) ? 1 : -1;
|
||||
|
||||
if ((me._dataEntryPos == 0) and (incr_or_decr == -1)) return; # Don't scroll off the start
|
||||
if ((me._dataEntryPos == me._size -1) and (incr_or_decr == 1)) return; # Don't scroll off the end
|
||||
|
||||
me.unhighlightCharElement();
|
||||
me._dataEntryPos = me._dataEntryPos + incr_or_decr;
|
||||
me.highlightCharElement();
|
||||
},
|
||||
};
|
13
Nasal/canvas/PFD/DefaultStyle.nas
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Default Styles for the MFD Elements
|
||||
var DefaultStyle = {
|
||||
CURSOR_BLINK_PERIOD : 0.5,
|
||||
|
||||
HIGHLIGHT_COLOR : "#80ffff",
|
||||
HIGHLIGHT_TEXT_COLOR : "#000000",
|
||||
|
||||
NORMAL_TEXT_COLOR : "#80ffff",
|
||||
|
||||
# Colors for the horizontal scroll arrows for ScrollElement
|
||||
SCROLL_AVAILABLE : "#80ffff",
|
||||
SCROLL_UNAVAILABLE : "#eeeeee"
|
||||
};
|
155
Nasal/canvas/PFD/GroupElement.nas
Normal file
|
@ -0,0 +1,155 @@
|
|||
# UIGroup.nas. A group of UI Elements that can be scrolled through
|
||||
var GroupElement =
|
||||
{
|
||||
|
||||
new : func (pageName, svg, elementNames, size, highlightElement, arrow=0, style=nil)
|
||||
{
|
||||
var obj = {
|
||||
parents : [ GroupElement ],
|
||||
_pageName : pageName,
|
||||
_svg : svg,
|
||||
_style : style,
|
||||
|
||||
# A hash mapping keys to the element name prefix of an SVG element
|
||||
_elementNames : elementNames,
|
||||
|
||||
# The size of the group. For each of the ._elementNames hash values there
|
||||
# must be an SVG Element [pageName][elementName]{0...pageSize}
|
||||
_size : size,
|
||||
|
||||
# Current size of the selectable elements.
|
||||
_currentSize : 0,
|
||||
|
||||
# ElementName to be highlighted. Must be an hash value from ._elementNames
|
||||
_highlightElement : highlightElement,
|
||||
|
||||
# Whether this is an arrow'd list. If so then highlightElement will be
|
||||
# hidden/shown for highlighting purposes.
|
||||
_arrow : arrow,
|
||||
|
||||
_elements : [],
|
||||
_crsrIndex : -1, # Cursor index into the elements array
|
||||
};
|
||||
|
||||
if (style == nil) obj._style = PFD.DefaultStyle;
|
||||
|
||||
for (var i = 0; i < size; i = i + 1) {
|
||||
if (obj._arrow == 1) {
|
||||
append(obj._elements, PFD.ArrowElement.new(pageName, svg, highlightElement ~ i, i, obj._style));
|
||||
} else {
|
||||
append(obj._elements, PFD.TextElement.new(pageName, svg, highlightElement ~ i, i, obj._style));
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
# Set the values of the group. values_array is an array of hashes, each of which
|
||||
# has keys that match those of ._elementNames
|
||||
setValues : func (values_array) {
|
||||
|
||||
# Determine how many of these we display
|
||||
me._currentSize = math.min(me._size, size(values_array));
|
||||
|
||||
for (var i = 0; i < me._currentSize; i = i + 1) {
|
||||
var values = values_array[i];
|
||||
foreach (var k; keys(values)) {
|
||||
if (k == me._highlightElement) {
|
||||
me._elements[i].unhighlightElement();
|
||||
me._elements[i].setValue(values[k]);
|
||||
} else {
|
||||
var name = me._pageName ~ k ~ i;
|
||||
var element = me._svg.getElementById(name);
|
||||
assert(element != nil, "Unable to find element " ~ name);
|
||||
element.setVisible(1);
|
||||
element.setText(values[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Hide any further elements
|
||||
if (me._currentSize < me._size) {
|
||||
for (var i = me._currentSize; i < me._size; i = i + 1) {
|
||||
foreach (var k; me._elementNames) {
|
||||
if (k == me._highlightElement) {
|
||||
me._elements[i].setVisible(0);
|
||||
} else {
|
||||
me._svg.getElementById(k ~ i).setVisible(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
# Methods to add dynamic elements to the group. Must be called in the
|
||||
# scroll order, as they are simply appended to the end of the list of elements!
|
||||
addArrowElement : func(name, value) {
|
||||
append(me._elements, ArrowElement.new(me._pageName, me._svg, name, value));
|
||||
},
|
||||
addTextElement : func(name, value) {
|
||||
append(me._elements, TextElement.new(me._pageName, me._svg, name, value));
|
||||
},
|
||||
|
||||
showCRSR : func() {
|
||||
if (me._currentSize == 0) return;
|
||||
me._crsrIndex = 0;
|
||||
me._elements[me._crsrIndex].highlightElement();
|
||||
},
|
||||
hideCRSR : func() {
|
||||
if (me._crsrIndex == -1) return;
|
||||
me._elements[me._crsrIndex].unhighlightElement();
|
||||
me.setCRSR(-1);
|
||||
},
|
||||
setCRSR : func(index) {
|
||||
me._crsrIndex = math.min(index, me._currentSize -1);
|
||||
},
|
||||
getCursorElementName : func() {
|
||||
if (me._crsrIndex == -1) return nil;
|
||||
return me._elements[me._crsrIndex].name;
|
||||
},
|
||||
isCursorOnDataEntryElement : func() {
|
||||
if (me._crsrIndex == -1) return 0;
|
||||
return isa(me._elements[me._crsrIndex], DataEntryElement);
|
||||
},
|
||||
enterElement : func() {
|
||||
if (me._crsrIndex == -1) return;
|
||||
return me._elements[me._crsrIndex].enterElement();
|
||||
},
|
||||
getValue : func() {
|
||||
if (me._crsrIndex == -1) return nil;
|
||||
return me._elements[me._crsrIndex].getValue();
|
||||
},
|
||||
clearElement : func() {
|
||||
if (me._crsrIndex == -1) return;
|
||||
me._elements[me._crsrIndex].clearElement();
|
||||
},
|
||||
incrSmall : func(value) {
|
||||
if (me._crsrIndex == -1) return;
|
||||
var incr_or_decr = (value > 0) ? 1 : -1;
|
||||
if (me._elements[me._crsrIndex].isInEdit()) {
|
||||
# We're editing, so pass to the element.
|
||||
#print("Moving cursor to next character entry");
|
||||
me._elements[me._crsrIndex].incrSmall();
|
||||
} else {
|
||||
# Move to next selection element
|
||||
me._elements[me._crsrIndex].unhighlightElement();
|
||||
me._crsrIndex = math.mod(me._crsrIndex + incr_or_decr, me._currentSize);
|
||||
me._elements[me._crsrIndex].highlightElement();
|
||||
}
|
||||
},
|
||||
incrLarge : func(val) {
|
||||
if (me._crsrIndex == -1) return;
|
||||
var incr_or_decr = (val > 0) ? 1 : -1;
|
||||
if (me._elements[me._crsrIndex].isInEdit()) {
|
||||
# We're editing, so pass to the element.
|
||||
#print("Moving cursor to next character entry");
|
||||
me._elements[me._crsrIndex].incrLarge();
|
||||
} else {
|
||||
# Move to next selection element
|
||||
me._elements[me._crsrIndex].unhighlightElement();
|
||||
me._crsrIndex = math.mod(me._crsrIndex + incr_or_decr, me._currentSize);
|
||||
me._elements[me._crsrIndex].highlightElement();
|
||||
}
|
||||
},
|
||||
};
|
118
Nasal/canvas/PFD/ScrollElement.nas
Normal file
|
@ -0,0 +1,118 @@
|
|||
# PFD UI Element - Scrolling UI Text Element.
|
||||
# Has a set of values and arrows left & right to indicate whether there are
|
||||
# further data items to scroll through.
|
||||
var ScrollElement =
|
||||
{
|
||||
|
||||
new : func (pageName, svg, name, values, initialIndex=0, style=nil)
|
||||
{
|
||||
var obj = {
|
||||
parents : [ ScrollElement, PFD.UIElement ],
|
||||
_name : pageName ~ name,
|
||||
_values : values,
|
||||
_index : 0,
|
||||
_style : style,
|
||||
};
|
||||
|
||||
if (style == nil) obj._style = PFD.DefaultStyle;
|
||||
|
||||
obj._symbol = svg.getElementById(obj._name);
|
||||
assert(obj._symbol != nil, "Unable to find element " ~ obj._name);
|
||||
|
||||
obj._leftsymbol = svg.getElementById(obj._name ~ "Left");
|
||||
assert(obj._leftsymbol != nil, "Unable to find element " ~ obj._name ~ "Left");
|
||||
|
||||
obj._rightsymbol = svg.getElementById(obj._name ~ "Right");
|
||||
assert(obj._rightsymbol != nil, "Unable to find element " ~ obj._name ~ "Right");
|
||||
|
||||
obj._index = initialIndex;
|
||||
assert(initialIndex < size(values) , "Initial index " ~ initialIndex ~ " extends past end of value array");
|
||||
|
||||
# State and timer for flashing highlighting of elements
|
||||
obj._highlighted = 0;
|
||||
obj._flashTimer = nil;
|
||||
|
||||
obj.updateValues();
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
updateValues : func() {
|
||||
if (me._index == 0 ) {
|
||||
me._leftsymbol.setColorFill(me._style.SCROLL_UNAVAILABLE);
|
||||
me._leftsymbol.setColor(me._style.SCROLL_UNAVAILABLE);
|
||||
} else {
|
||||
me._leftsymbol.setColorFill(me._style.SCROLL_AVAILABLE);
|
||||
me._leftsymbol.setColor(me._style.SCROLL_AVAILABLE);
|
||||
}
|
||||
|
||||
if ((size(me._values) > 0) and (me._index < (size(me._values) -1))) {
|
||||
me._rightsymbol.setColorFill(me._style.SCROLL_AVAILABLE);
|
||||
me._rightsymbol.setColor(me._style.SCROLL_AVAILABLE);
|
||||
} else {
|
||||
me._rightsymbol.setColorFill(me._style.SCROLL_UNAVAILABLE);
|
||||
me._rightsymbol.setColor(me._style.SCROLL_UNAVAILABLE);
|
||||
}
|
||||
|
||||
me._symbol.setText(me._values[me._index]);
|
||||
},
|
||||
|
||||
getName : func() { return me._name; },
|
||||
getValue : func() { return me._symbol.getText(); },
|
||||
setValue : func(value) {
|
||||
var idx = find(value, me._values);
|
||||
if (idx != -1) {
|
||||
me._index = idx;
|
||||
me._symbol.setText(value);
|
||||
}
|
||||
},
|
||||
setValues : func(values) {
|
||||
me._values = values;
|
||||
me._index = 0;
|
||||
me.updateValues();
|
||||
},
|
||||
setVisible : func(vis) {
|
||||
me._symbol.setVisible(vis);
|
||||
me._leftsymbol.setVisible(vis);
|
||||
me._rightsymbol.setVisible(vis);
|
||||
},
|
||||
_flashElement : func() {
|
||||
if (me._highlighted == 0) {
|
||||
me._symbol.setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX);
|
||||
me._symbol.setColorFill(me._style.HIGHLIGHT_COLOR);
|
||||
me._symbol.setColor(me._style.HIGHLIGHT_TEXT_COLOR);
|
||||
me._highlighted = 1;
|
||||
} else {
|
||||
me._symbol.setDrawMode(canvas.Text.TEXT);
|
||||
me._symbol.setColor(me._style.NORMAL_TEXT_COLOR);
|
||||
me._highlighted = 0;
|
||||
}
|
||||
},
|
||||
highlightElement : func() {
|
||||
me._flashElement();
|
||||
me._flashTimer = maketimer(0.5, me, me._flashElement);
|
||||
me._flashTimer.start();
|
||||
},
|
||||
unhighlightElement : func() {
|
||||
if (me._flashTimer != nil) me._flashTimer.stop();
|
||||
me._flashTimer = nil;
|
||||
|
||||
# Reset the highlight to a non-highlighted state.
|
||||
me._highlighted = 1;
|
||||
me._flashElement();
|
||||
},
|
||||
isEditable : func () { return 0; },
|
||||
isInEdit : func() { return 0; },
|
||||
enterElement : func() { return me.getValue(); },
|
||||
clearElement : func() { },
|
||||
editElement : func() { },
|
||||
incrSmall : func(value) {
|
||||
# Increment the scroll value;
|
||||
var incr_or_decr = (value > 0) ? 1 : -1;
|
||||
if ((me._index + incr_or_decr) < 0) return;
|
||||
if ((me._index + incr_or_decr) > (size(me._values) -1)) return;
|
||||
me._index = me._index + incr_or_decr;
|
||||
me.updateValues();
|
||||
},
|
||||
incrLarge : func(value) { },
|
||||
};
|
62
Nasal/canvas/PFD/TextElement.nas
Normal file
|
@ -0,0 +1,62 @@
|
|||
# PFD UI Element - Text UI Element. Can have values set and retrieved
|
||||
var TextElement =
|
||||
{
|
||||
new : func (pagename, svg, name, value="", style=nil)
|
||||
{
|
||||
var obj = {
|
||||
parents : [ TextElement, PFD.UIElement ],
|
||||
_name : pagename ~ name,
|
||||
_edit : 0,
|
||||
_style : style,
|
||||
};
|
||||
|
||||
if (style == nil) obj._style = PFD.DefaultStyle;
|
||||
|
||||
obj._symbol = svg.getElementById(obj._name);
|
||||
if (obj._symbol == nil) die("Unable to find element " ~ obj._name);
|
||||
obj.setValue(value);
|
||||
|
||||
# State and timer for flashing highlighting of elements
|
||||
obj._highlighted = 0;
|
||||
obj._flashTimer = nil;
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
getName : func() { return me._name; },
|
||||
getValue : func() { return me._symbol.getText(); },
|
||||
setValue : func(value) { me._symbol.setText(value); },
|
||||
setVisible : func(vis) { me._symbol.setVisible(vis); },
|
||||
_flashElement : func() {
|
||||
if (me._highlighted == 0) {
|
||||
me._symbol.setDrawMode(canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX);
|
||||
me._symbol.setColorFill(me._style.HIGHLIGHT_COLOR);
|
||||
me._symbol.setColor(me._style.HIGHLIGHT_TEXT_COLOR);
|
||||
me._highlighted = 1;
|
||||
} else {
|
||||
me._symbol.setDrawMode(canvas.Text.TEXT);
|
||||
me._symbol.setColor(me._style.NORMAL_TEXT_COLOR);
|
||||
me._highlighted = 0;
|
||||
}
|
||||
},
|
||||
highlightElement : func() {
|
||||
me._flashElement();
|
||||
me._flashTimer = maketimer(me._style.CURSOR_BLINK_PERIOD, me, me._flashElement);
|
||||
me._flashTimer.start();
|
||||
},
|
||||
unhighlightElement : func() {
|
||||
if (me._flashTimer != nil) me._flashTimer.stop();
|
||||
me._flashTimer = nil;
|
||||
|
||||
# Reset the highlight to a non-highlighted state.
|
||||
me._highlighted = 1;
|
||||
me._flashElement();
|
||||
},
|
||||
isEditable : func () { return 0; },
|
||||
isInEdit : func() { return 0; },
|
||||
enterElement : func() { return me.getValue(); },
|
||||
clearElement : func() { },
|
||||
editElement : func() { },
|
||||
incrSmall : func(value) { },
|
||||
incrLarge : func(value) { },
|
||||
};
|
29
Nasal/canvas/PFD/UIElement.nas
Normal file
|
@ -0,0 +1,29 @@
|
|||
# MFD UI Element - abstract class
|
||||
var UIElement =
|
||||
{
|
||||
new : func (name, value)
|
||||
{
|
||||
var obj = {
|
||||
parents : [ UIElement ],
|
||||
_name : name,
|
||||
_edit : 0,
|
||||
_value : value,
|
||||
};
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
getName : func() { return me._name; },
|
||||
setValue : func(value) { me._value = value; },
|
||||
getValue : func() { return me._value; },
|
||||
highlightElement : func() { },
|
||||
unhighlightElement : func() { },
|
||||
isEditable : func () { return 0; },
|
||||
isInEdit : func() { return me._edit; },
|
||||
enterElement : func() { me._edit = 0; return me._value; },
|
||||
clearElement : func() { me._edit = 0; },
|
||||
editElement : func() { me._edit = 1; },
|
||||
setVisible : func(vis) { },
|
||||
incrSmall : func(value) { },
|
||||
incrLarge : func(value) { },
|
||||
};
|
|
@ -617,6 +617,10 @@ var Text = {
|
|||
{
|
||||
me.set("text", typeof(text) == 'scalar' ? text : "");
|
||||
},
|
||||
getText: func()
|
||||
{
|
||||
return me.get("text");
|
||||
},
|
||||
# enable reduced property I/O update function
|
||||
enableUpdate: func ()
|
||||
{
|
||||
|
|
|
@ -382,48 +382,51 @@
|
|||
);
|
||||
|
||||
append(listeners, softkey_listener);
|
||||
#append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-incr-large-pressed", func(v) { mfd._pageGroupController.incrFMSOuter(); } ));
|
||||
#append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-incr-small-pressed", func(v) { mfd._pageGroupController.incrFMSInner(); } ));
|
||||
#append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-decr-large-pressed", func(v) { mfd._pageGroupController.decrFMSOuter(); } ));
|
||||
#append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-decr-small-pressed", func(v) { mfd._pageGroupController.decrFMSInner(); } ));
|
||||
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-incr-large-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.FMS_OUTER, Value: 1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.FMS_OUTER, Value: 1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-incr-small-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.FMS_INNER, Value: 1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.FMS_INNER, Value: 1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-decr-large-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.FMS_OUTER, Value: -1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.FMS_OUTER, Value: -1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/fms-decr-small-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.FMS_INNER, Value: -1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.FMS_INNER, Value: -1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/range-decr-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.RANGE, Value: -1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.RANGE, Value: -1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/range-incr-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.RANGE, Value: 1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.RANGE, Value: 1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/crsr-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.MFD.FASCIA.FMS_CRSR, Value: 1.0 });
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.FMS_CRSR, Value: 1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/ent-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.ENT, Value: 1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
append(listeners, setlistener("/sim/gui/dialogs/fg1000/clr-pressed", func(v) {
|
||||
var notification = notifications.PFDEventNotification.new("MFD", 1, notifications.PFDEventNotification.HardKeyPushed, { Id: fg1000.FASCIA.CLR, Value: 1.0 });
|
||||
emesary.GlobalTransmitter.NotifyAll(notification);
|
||||
} ));
|
||||
|
||||
|
||||
]]></load></nasal>
|
||||
|
@ -824,6 +827,11 @@
|
|||
<pref-height>25</pref-height>
|
||||
<name>CLR</name>
|
||||
<legend>CLR</legend>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/sim/gui/dialogs/fg1000/clr-pressed</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
</button>
|
||||
<button>
|
||||
<col>1</col><row>2</row>
|
||||
|
@ -831,6 +839,11 @@
|
|||
<pref-height>25</pref-height>
|
||||
<name>ENT</name>
|
||||
<legend>ENT</legend>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/sim/gui/dialogs/fg1000/ent-pressed</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
|
|