From 573de77cb8f3ef22ece0afc0076d938f157c74e2 Mon Sep 17 00:00:00 2001 From: Gijs de Rooy Date: Sun, 6 Jul 2014 23:17:47 +0200 Subject: [PATCH] Navdisplay: bug fixed and new features - Correct z-index - Add MAP CTR compass - Fix active WPT color - Hide wind data at low speeds - Move code outside main update loop - Correct ranges --- Nasal/canvas/map/DME.symbol | 3 +- Nasal/canvas/map/FIX.symbol | 5 +- Nasal/canvas/map/Images/boeingND.svg | 2864 +++++++++++++----------- Nasal/canvas/map/VOR.symbol | 9 +- Nasal/canvas/map/WPT.symbol | 14 +- Nasal/canvas/map/WXR.symbol | 3 +- Nasal/canvas/map/airports-nd.draw | 2 +- Nasal/canvas/map/altitude-profile.draw | 2 +- Nasal/canvas/map/fix.draw | 2 +- Nasal/canvas/map/navdisplay.mfd | 280 +-- Nasal/canvas/map/navdisplay.styles | 209 +- Nasal/canvas/map/navdisplayLayers.txt | 11 + Nasal/canvas/map/route.draw | 3 +- Nasal/canvas/map/traffic.draw | 2 +- 14 files changed, 1945 insertions(+), 1464 deletions(-) create mode 100644 Nasal/canvas/map/navdisplayLayers.txt diff --git a/Nasal/canvas/map/DME.symbol b/Nasal/canvas/map/DME.symbol index f552b5752..c31fb1010 100644 --- a/Nasal/canvas/map/DME.symbol +++ b/Nasal/canvas/map/DME.symbol @@ -118,7 +118,8 @@ var init = func { .horiz(-14.5) .vert(-14.5) .close() - .setStrokeLineWidth( me.layer.style.line_width ); + .setStrokeLineWidth( me.layer.style.line_width ) + .set("z-index",-2); # finally scale the symbol as requested, this is done last so that people can override this when creating the layer me.apply_scale(); diff --git a/Nasal/canvas/map/FIX.symbol b/Nasal/canvas/map/FIX.symbol index 62fe8bd39..ce36dd8bc 100644 --- a/Nasal/canvas/map/FIX.symbol +++ b/Nasal/canvas/map/FIX.symbol @@ -28,7 +28,8 @@ var drawFIX = func(group) { .lineTo(15,15) .close() .setStrokeLineWidth(line_width) - .setColor(color); + .setColor(color) + .set("z-index",-3); } var cache = StyleableCacheable.new( @@ -44,6 +45,6 @@ var init = func { # non-cached stuff: if (me.style.show_labels) - me.text_fix = me.newText(me.model.id).setScale(me.style.scale_factor); + me.text_fix = me.newText(me.model.id).setScale(me.style.scale_factor).setTranslation(17,35).set("z-index",-3); } var draw = func; diff --git a/Nasal/canvas/map/Images/boeingND.svg b/Nasal/canvas/map/Images/boeingND.svg index 13013d47b..f40b1babe 100644 --- a/Nasal/canvas/map/Images/boeingND.svg +++ b/Nasal/canvas/map/Images/boeingND.svg @@ -24,17 +24,17 @@ guidetolerance="10" inkscape:pageopacity="1" inkscape:pageshadow="2" - inkscape:window-width="1360" - inkscape:window-height="711" + inkscape:window-width="1366" + inkscape:window-height="716" id="namedview102" showgrid="false" - inkscape:zoom="4" - inkscape:cx="935.56631" - inkscape:cy="485.54807" - inkscape:window-x="0" - inkscape:window-y="33" + inkscape:zoom="0.5" + inkscape:cx="-212.63" + inkscape:cy="501.603" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" - inkscape:current-layer="layer1" + inkscape:current-layer="layer4" inkscape:object-nodes="true" inkscape:snap-smooth-nodes="true" inkscape:snap-object-midpoints="true" @@ -42,10 +42,7 @@ inkscape:snap-to-guides="false">image/svg+xmlGijs de RooyGijs de RooyABCD + inkscape:groupmode="layer">ABCD + 999.9 + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="844.04407" + y="126.12489" + id="wpActiveDist" + sodipodi:linespacing="125%" + inkscape:label="#text7243">999.9 + 999°/ 99 + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" + id="aplSymMap" + d="m 541.5,892 -59,0 29.5,-68 z" + style="fill:none;stroke:#ededed;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:label="#path7253" />999°/ 99 + 999 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="gs" + y="53.306854" + x="77.874374" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">999 + 999 + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="210.49673" + y="53.306854" + id="tas" + sodipodi:linespacing="125%" + inkscape:label="#text7243">999 + GS + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="38.276394" + y="53.306854" + id="gsLbl" + sodipodi:linespacing="125%" + inkscape:label="#text7243">GS + TAS + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="tasLbl" + y="53.306854" + x="158.17084" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">TAS + 999 + id="hdgGroup" + inkscape:label="#g3141">999 + HDG + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="hdgTrk" + y="67.549522" + x="373.44498" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">HDG + MAG + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="578.66278" + y="67.549522" + id="truMag" + sodipodi:linespacing="125%" + inkscape:label="#text7243">MAG + VOR L + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="41.732624" + y="913.5495" + id="vorL" + sodipodi:linespacing="125%" + inkscape:label="#text7243">VOR L + DME + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="dmeL" + y="993.85461" + x="41.732624" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">DME + 99.9 + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="101.1296" + y="993.85461" + id="dmeLDist" + sodipodi:linespacing="125%" + inkscape:label="#text7243">99.9 + ABC + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="41.732624" + y="954.56171" + id="vorLId" + sodipodi:linespacing="125%" + inkscape:label="#text7243">ABC + VOR R + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="vorR" + y="913.5495" + x="889.7326" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">VOR R + DME + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="889.7326" + y="993.85461" + id="dmeR" + sodipodi:linespacing="125%" + inkscape:label="#text7243">DME + 99.9 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="dmeRDist" + y="993.85461" + x="949.12958" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">99.9 + ABC + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="vorRId" + y="954.56171" + x="889.7326" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">ABC + 08 34.4z + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="eta" + y="90.062447" + x="844.04407" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">08 34.4z + 0 + inkscape:label="#g3124" + id="compass">0 + 33 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3080" + y="344.7804" + x="9.1033907" + style="font-size:35.999943px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(0.866025,-0.5,0.5,0.866025,0,0)">33 + 30 + transform="matrix(0.5,-0.866026,0.866026,0.5,0,0)" + xml:space="preserve" + style="font-size:36.000011px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-478.97894" + y="231.34868" + id="text3084" + sodipodi:linespacing="125%" + inkscape:label="#text7243">30 + 27 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3088" + y="-108.93858" + x="-845.96948" + style="font-size:36.000011px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(0,-1,1,0,0,0)">27 + 24 + transform="matrix(-0.5,-0.866025,0.866025,-0.5,0,0)" + xml:space="preserve" + style="font-size:35.999977px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-992.34058" + y="-584.99097" + id="text3092" + sodipodi:linespacing="125%" + inkscape:label="#text7243">24 + 21 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3096" + y="-1071.5541" + x="-879.19897" + style="font-size:36.000046px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(-0.866026,-0.5,0.5,-0.866026,0,0)">21 + 18 + transform="scale(-1,-1)" + xml:space="preserve" + style="font-size:36.000027px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-533.67151" + y="-1436.3594" + id="text3100" + sodipodi:linespacing="125%" + inkscape:label="#text7243">18 + 15 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3104" + y="-1581.0712" + x="-51.792171" + style="font-size:36.000004px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(-0.866025,0.5,-0.5,-0.866025,0,0)">15 + 12 + transform="matrix(-0.5,0.866026,-0.866026,-0.5,0,0)" + xml:space="preserve" + style="font-size:36.000042px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="435.97983" + y="-1462.8785" + id="text3108" + sodipodi:linespacing="125%" + inkscape:label="#text7243">12 + 9 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3112" + y="-1123.9312" + x="812.80585" + style="font-size:36.000042px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(0,1,-1,0,0,0)">9 + 6 + transform="matrix(0.5,0.866025,-0.866025,0.5,0,0)" + xml:space="preserve" + style="font-size:36.000019px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="958.43561" + y="-645.76654" + id="text3116" + sodipodi:linespacing="125%" + inkscape:label="#text7243">6 + 3 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3120" + y="-158.40652" + x="844.79596" + style="font-size:36.000095px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(0.866026,0.5,-0.5,0.866026,0,0)">3 + 99 + sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccscccscccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccccc" + id="path3181" + d="m 512.162,122.464 -0.03,43.913 c 0.02,0 0.04,0 0.06,0 z m -121.834,10.683 7.445,42.355 c 0.02,0 0.04,-0.03 0.06,-0.03 l -7.506,-42.324 z m 243.668,0 -7.817,44.037 c 0.03,0 0.06,0 0.09,0 l 7.724,-44.037 z m -361.763,31.641 14.42,39.771 c 0.03,-0.01 0.06,-0.02 0.09,-0.03 z m 479.859,0 -15.666,42.948 c 0.02,0 0.04,0.02 0.06,0.03 l 15.603,-42.978 z m -590.7,51.668 20.93,36.345 c 0.02,-0.01 0.04,-0.02 0.06,-0.03 l -20.993,-36.313 z m 701.536,0 -23.41,40.703 m -778.2827,29.434 26.846,32.078 c 0.02,-0.02 0.04,-0.04 0.06,-0.06 l -26.908,-32.015 z m 901.8497,0 -31.044,36.935 m -957.2909,49.55 32.01553,26.908 c 0.0199,-0.02 0.0398,-0.04 0.0598,-0.06 L -25.2519,373.078 z m 1036.9299,31.77 c 0,0.02 0,0.05 0,0.06 l 37.87,-31.83 c -12.51,10.544 -25.26,21.2 -37.87,31.77 z m -1107.065,68.391 36.3128,20.992 c 0.01,-0.02 0.02,-0.04 0.03,-0.06 l -36.3447,-20.929 z m 1215.085,0 -43.8,25.258 c 0,0.02 0,0.04 0,0.06 l 43.77,-25.321 z m -1266.752,110.841 39.739,14.512 c 0.01,-0.03 0.02,-0.06 0.03,-0.09 l -39.771,-14.42 z m 1318.422,0 -48.55,17.628 c 0,0.03 0,0.06 0,0.09 l 48.52,-17.72 z m -1350.064,118.096 42.325,7.506 c 0,-0.02 0.03,-0.04 0.03,-0.06 l -42.356,-7.444 z m 1381.704,0 -51.94,9.125 c 0,0.03 0,0.06 0,0.09 l 51.94,-9.219 z m -43.15,121.773 c 0,0.04 0,0.08 0,0.123 l 53.84,-0.06 -53.84,-0.06 z m -1305.324,0.03 -43.912,0.03 43.912,0.03 c 0,-0.02 0,-0.04 0,-0.06 z M 1149.36,936.341 c 0,0.03 0,0.06 0,0.09 l 53.65,9.407 -53.65,-9.5 z m -1284.017,1.683 -44.037,7.817 44.037,-7.723 c 0,-0.03 0,-0.06 0,-0.09 z m 1254.357,107.046 0,0.1 51.7,18.77 -51.67,-18.87 z m -1223.804,3.21 -42.948,15.66 42.978,-15.6 c 0,0 -0.02,0 -0.03,-0.1 z m 1175.754,98.68 -0.1,0.1 48.12,27.72 -48.05,-27.82 z m -1126.393,4.3 -40.642,23.52 40.6729,-23.46 c -0.01,0 -0.02,0 -0.03,-0.1 z m 1061.593,87.76 c 0,0 0,0 -0.1,0.1 l 42.79,35.85 -42.73,-35.91 z m -995.1642,4.86 -36.9357,31.05 36.9984,-30.98 c -0.02,0 -0.04,-0.1 -0.06,-0.1 z m 915.5522,74.74 c 0,0 0,0 -0.1,0.1 l 35.917,42.72 -35.847,-42.79 z m -834.2365,4.89 -31.7662,37.9 31.829,-37.87 c -0.02,0 -0.05,0 -0.06,0 z m 742.2105,59.92 -0.1,0.1 27.816,48.04 -27.726,-48.11 z m -648.561,4.31 -25.259,43.8 25.322,-43.77 c -0.02,0 -0.04,0 -0.06,0 z m 546.661,43.77 c -0.03,0 -0.06,0 -0.09,0 l 18.874,51.68 -18.78,-51.71 z m -443.452,3.15 -17.627,48.56 17.721,-48.53 c -0.03,0 -0.06,0 -0.09,0 z m 334.729,26.54 c -0.03,0 -0.06,0 -0.09,0 l 9.499,53.63 -9.407,-53.66 z m -225.135,1.71 -9.126,51.95 9.22,-51.95 c -0.03,0 -0.06,0 -0.09,0 z m 112.646,8.78 0.06,53.85 0.06,-53.85 c -0.04,0 -0.08,0 -0.124,0 z" + style="fill:#ededed;fill-opacity:1;fill-rule:nonzero;stroke:#ededed;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" + inkscape:connector-curvature="0" />99 + TA ONLY + sodipodi:nodetypes="cscc" + inkscape:connector-curvature="0" + id="altArc" + d="m 350.959,863.607 c 0,0 72.1,-39.455 161.041,-39.455 88.941,0 161.041,39.455 161.041,39.455 l 0,0" + style="fill:none;stroke:#00ff00;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" + inkscape:label="#path3888-1" + inkscape:transform-center-y="19.8725" />TA ONLY + WXR + id="staArrowL" + inkscape:label="#g4072" + inkscape:transform-center-y="-2.9215">WXR + ARPT + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="status.arpt" + y="734.12946" + x="41.732624" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#0099d9;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">ARPT + WPT + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#0099d9;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="41.732624" + y="697.12939" + id="status.wpt" + sodipodi:linespacing="125%" + inkscape:label="#text7243">WPT + STA + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="status.sta" + y="661.12933" + x="41.732624" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#0099d9;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">STA + NM + inkscape:label="#path7253" + style="fill:none;stroke:#ededed;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 541.5,627.342 -59,0 29.5,-68 z" + id="aplSymMapCtr" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" />NM + ILS L + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#32f519;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="803.289" + y="53.929054" + id="ilsLbl" + sodipodi:linespacing="125%" + inkscape:label="#text7243">ILS L + 999.99 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="ilsFreq" + y="53.929054" + x="888.28894" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">999.99 + 0 + id="aplSymVor" + style="fill:none;stroke:#ededed;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + d="m 523.994,501.789 0,58 51.042,0 m -51.042,0 0,57 18.782,0 m -43.653,-115 0,58 -50.158,0 m 50.158,0 0,57 -19.136,0" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccc" + inkscape:label="#path3895" + inkscape:transform-center-y="0.309359" />0 + 33 + transform="matrix(0.866025,-0.5,0.5,0.866025,0,0)" + xml:space="preserve" + style="font-size:35.999931px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-13.265571" + y="377.83694" + id="text3924" + sodipodi:linespacing="125%" + inkscape:label="#text7243">33 + 30 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3928" + y="265.32059" + x="-503.69513" + style="font-size:36.000031px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(0.5,-0.866026,0.866026,0.5,0,0)">30 + 27 + transform="matrix(0,-1,1,0,0,0)" + xml:space="preserve" + style="font-size:36.000011px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-868.71942" + y="-71.969933" + id="text3932" + sodipodi:linespacing="125%" + inkscape:label="#text7243">27 + 24 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3936" + y="-541.37213" + x="-1019.1653" + style="font-size:35.999966px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(-0.5,-0.866025,0.866025,-0.5,0,0)">24 + 21 + transform="matrix(-0.866026,-0.5,0.5,-0.866026,0,0)" + xml:space="preserve" + style="font-size:36.000065px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-904.95624" + y="-1033.6982" + id="text3940" + sodipodi:linespacing="125%" + inkscape:label="#text7243">21 + 18 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3944" + y="-1392.2814" + x="-557.84332" + style="font-size:36.000027px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="scale(-1,-1)">18 + 15 + transform="matrix(-0.866025,0.5,-0.5,-0.866025,0,0)" + xml:space="preserve" + style="font-size:35.999992px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="-71.888855" + y="-1543.4183" + id="text3948" + sodipodi:linespacing="125%" + inkscape:label="#text7243">15 + 12 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3952" + y="-1431.3702" + x="409.84222" + style="font-size:36.000061px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(-0.5,0.866026,-0.866026,-0.5,0,0)">12 + 9 + transform="matrix(0,1,-1,0,0,0)" + xml:space="preserve" + style="font-size:36.000042px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="801.43085" + y="-1088.3844" + id="text3956" + sodipodi:linespacing="125%" + inkscape:label="#text7243">9 + 6 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="text3960" + y="-611.09729" + x="941.70276" + style="font-size:36.000008px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve" + transform="matrix(0.5,0.866025,-0.866025,0.5,0,0)">6 + 3 + transform="matrix(0.866026,0.5,-0.5,0.866026,0,0)" + xml:space="preserve" + style="font-size:36.000114px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="831.16284" + y="-130.83325" + id="text3964" + sodipodi:linespacing="125%" + inkscape:label="#text7243">3 + CRS + inkscape:connector-curvature="0" + style="fill:#ededed;fill-opacity:1;fill-rule:nonzero;stroke:#ededed;stroke-width:10.054152;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" + d="m 512.162,122.464 -0.03,43.913 c 0.02,0 0.04,0 0.06,0 z m -121.834,10.683 7.445,42.355 c 0.02,0 0.04,-0.03 0.06,-0.03 l -7.506,-42.324 z m 243.668,0 -7.817,44.037 c 0.03,0 0.06,0 0.09,0 l 7.724,-44.037 z m -361.763,31.641 14.42,39.771 c 0.03,-0.01 0.06,-0.02 0.09,-0.03 z m 479.859,0 -15.666,42.948 c 0.02,0 0.04,0.02 0.06,0.03 l 15.603,-42.978 z m -590.7,51.668 20.93,36.345 c 0.02,-0.01 0.04,-0.02 0.06,-0.03 l -20.993,-36.313 z m 701.536,0 -23.41,40.703 m -778.2827,29.434 26.846,32.078 c 0.02,-0.02 0.04,-0.04 0.06,-0.06 l -26.908,-32.015 z m 901.8497,0 -31.044,36.935 m -957.2909,49.55 32.01553,26.908 c 0.0199,-0.02 0.0398,-0.04 0.0598,-0.06 L -25.2519,373.078 z m 1036.9299,31.77 c 0,0.02 0,0.05 0,0.06 l 37.87,-31.83 c -12.51,10.544 -25.26,21.2 -37.87,31.77 z m -1107.065,68.391 36.3128,20.992 c 0.01,-0.02 0.02,-0.04 0.03,-0.06 l -36.3447,-20.929 z m 1215.085,0 -43.8,25.258 c 0,0.02 0,0.04 0,0.06 l 43.77,-25.321 z m -1266.752,110.841 39.739,14.512 c 0.01,-0.03 0.02,-0.06 0.03,-0.09 l -39.771,-14.42 z m 1318.422,0 -48.55,17.628 c 0,0.03 0,0.06 0,0.09 l 48.52,-17.72 z m -1350.064,118.096 42.325,7.506 c 0,-0.02 0.03,-0.04 0.03,-0.06 l -42.356,-7.444 z m 1381.704,0 -51.94,9.125 c 0,0.03 0,0.06 0,0.09 l 51.94,-9.219 z m -43.15,121.773 c 0,0.04 0,0.08 0,0.123 l 53.84,-0.06 -53.84,-0.06 z m -1305.324,0.03 -43.912,0.03 43.912,0.03 c 0,-0.02 0,-0.04 0,-0.06 z M 1149.36,936.341 c 0,0.03 0,0.06 0,0.09 l 53.65,9.407 -53.65,-9.5 z m -1284.017,1.683 -44.037,7.817 44.037,-7.723 c 0,-0.03 0,-0.06 0,-0.09 z m 1254.357,107.046 0,0.1 51.7,18.77 -51.67,-18.87 z m -1223.804,3.21 -42.948,15.66 42.978,-15.6 c 0,0 -0.02,0 -0.03,-0.1 z m 1175.754,98.68 -0.1,0.1 48.12,27.72 -48.05,-27.82 z m -1126.393,4.3 -40.642,23.52 40.6729,-23.46 c -0.01,0 -0.02,0 -0.03,-0.1 z m 1061.593,87.76 c 0,0 0,0 -0.1,0.1 l 42.79,35.85 -42.73,-35.91 z m -995.1642,4.86 -36.9357,31.05 36.9984,-30.98 c -0.02,0 -0.04,-0.1 -0.06,-0.1 z m 915.5522,74.74 c 0,0 0,0 -0.1,0.1 l 35.917,42.72 -35.847,-42.79 z m -834.2365,4.89 -31.7662,37.9 31.829,-37.87 c -0.02,0 -0.05,0 -0.06,0 z m 742.2105,59.92 -0.1,0.1 27.816,48.04 -27.726,-48.11 z m -648.561,4.31 -25.259,43.8 25.322,-43.77 c -0.02,0 -0.04,0 -0.06,0 z m 546.661,43.77 c -0.03,0 -0.06,0 -0.09,0 l 18.874,51.68 -18.78,-51.71 z m -443.452,3.15 -17.627,48.56 17.721,-48.53 c -0.03,0 -0.06,0 -0.09,0 z m 334.729,26.54 c -0.03,0 -0.06,0 -0.09,0 l 9.499,53.63 -9.407,-53.66 z m -225.135,1.71 -9.126,51.95 9.22,-51.95 c -0.03,0 -0.06,0 -0.09,0 z m 112.646,8.78 0.06,53.85 0.06,-53.85 c -0.04,0 -0.08,0 -0.124,0 z" + id="path3968" + sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccscccscccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccccc" />CRS + DME + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="854.72168" + y="124.87983" + id="dmeLbl" + sodipodi:linespacing="125%" + inkscape:label="#text7243">DME + 999 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="crs" + y="90.062439" + x="913.95801" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">999 + 99.9 + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="913.95801" + y="126.12444" + id="dme" + sodipodi:linespacing="125%" + inkscape:label="#text7243">99.9 + 0 + +33 + +30 + +27 + +24 + +21 + +18 + +15 + +12 + +9 + +6 + +3 + +99 +99 +N + style="display:inline" + id="planArcs" + inkscape:label="#g3956" + transform="matrix(1.02827,0,0,1.02827,-14.7256,-29.1838)">N + W + inkscape:label="#path3017" + sodipodi:nodetypes="cccccc" + inkscape:connector-curvature="0" + id="path3180" + d="m 522.504,63.7561 0,-24.042 m 0,0 -2.588,4.481 5.465,0 -2.877,-4.481" + style="fill:#00ff00;stroke:#00ff00;stroke-width:1.844872;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />W + E + sodipodi:linespacing="125%" + id="text3209" + y="530.25165" + x="962.65656" + style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#00ff00;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">E + S + xml:space="preserve" + style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#00ff00;fill-opacity:1;stroke:none;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="503.03763" + y="1008.2553" + id="text3213" + sodipodi:linespacing="125%">S + 99 + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="511.74799" + y="320.56113" + id="rangePln2" + sodipodi:linespacing="125%" + inkscape:label="#text7243">99 + 99 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="rangePln1" + y="102.56212" + x="512.06421" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">99 + 99 + xml:space="preserve" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + x="512.21063" + y="752.73596" + id="rangePln3" + sodipodi:linespacing="125%" + inkscape:label="#text7243">99 + 99 + inkscape:label="#text7243" + sodipodi:linespacing="125%" + id="rangePln4" + y="968.55823" + x="511.77499" + style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#ededed;fill-opacity:1;stroke:none;display:inline;font-family:Liberation Sans;-inkscape-font-specification:Liberation Sans" + xml:space="preserve">99 + \ No newline at end of file diff --git a/Nasal/canvas/map/VOR.symbol b/Nasal/canvas/map/VOR.symbol index 3bd2edb08..9c1773134 100644 --- a/Nasal/canvas/map/VOR.symbol +++ b/Nasal/canvas/map/VOR.symbol @@ -38,7 +38,8 @@ var drawVOR = func(group) { .lineTo(-7.5,-12.5) .close() .setStrokeLineWidth(line_width) - .setColor(color); + .setColor(color) + .set("z-index",-2); }; var cache = StyleableCacheable.new( @@ -87,7 +88,8 @@ var draw = func { .arcSmallCW(radius,radius,0,-2*radius,0) .setStrokeLineWidth(me.style.range_line_width) .setStrokeDashArray(me.style.range_dash_array) - .setColor(me.style.active_color); + .setColor(me.style.active_color) + .set("z-index",-2); var course = me.map.controller.get_tuned_course(me.model.frequency/100); me.radial_vor = me.element.createChild("path") @@ -96,7 +98,8 @@ var draw = func { .setStrokeLineWidth(me.style.radial_line_width) .setStrokeDashArray(me.style.radial_dash_array) .setColor(me.style.active_color) - .setRotation(course*D2R); + .setRotation(course*D2R) + .set("z-index",-2); } me.range_vor.show(); me.radial_vor.show(); diff --git a/Nasal/canvas/map/WPT.symbol b/Nasal/canvas/map/WPT.symbol index 2c6b4d42f..1c0895e99 100644 --- a/Nasal/canvas/map/WPT.symbol +++ b/Nasal/canvas/map/WPT.symbol @@ -31,10 +31,13 @@ var init = func { .lineTo(5,-5) .setColor(1,1,1) .close() - .setScale(me.style.scale_factor); + .setScale(me.style.scale_factor) + .set("z-index",2); - me.newText(me.model.name, me.style.font_color).setTranslation(25,35) - .setScale(me.style.scale_factor); + me.text = me.newText(me.model.name, me.style.font_color) + .setTranslation(25,35) + .setScale(me.style.scale_factor) + .set("z-index",2); me.draw(); }; @@ -46,6 +49,11 @@ var draw = func { me.style.active_color : me.style.inactive_color ); + me.text.setColor( + active ? + me.style.active_color : + me.style.inactive_color + ); me.active = active; } }; diff --git a/Nasal/canvas/map/WXR.symbol b/Nasal/canvas/map/WXR.symbol index 86d1dee53..21169ce03 100644 --- a/Nasal/canvas/map/WXR.symbol +++ b/Nasal/canvas/map/WXR.symbol @@ -15,7 +15,8 @@ var draw = func { .setFile("Nasal/canvas/map/Images/storm.png") .setSize(128*me.model.radiusNm,128*me.model.radiusNm) .setTranslation(-64*me.model.radiusNm,-64*me.model.radiusNm) - .setCenter(0,0); + .setCenter(0,0) + .set("z-index",-4); # .setScale(0.3); # TODO: overlapping storms should probably set their z-index according to altitudes diff --git a/Nasal/canvas/map/airports-nd.draw b/Nasal/canvas/map/airports-nd.draw index 8ea3f4e1b..5bc8c983b 100644 --- a/Nasal/canvas/map/airports-nd.draw +++ b/Nasal/canvas/map/airports-nd.draw @@ -27,7 +27,7 @@ var draw_apt = func (group, apt, controller=nil, lod=0) { .setColor(0,0.6,0.85) .setFontSize(28); apt_grp.setGeoPosition(lat, lon) - .set("z-index",1); # FIXME: this needs to be configurable!! + .set("z-index",-1); # FIXME: this needs to be configurable!! #} # draw routines should always return their canvas group to the caller for further processing diff --git a/Nasal/canvas/map/altitude-profile.draw b/Nasal/canvas/map/altitude-profile.draw index 151f63a96..18a81d257 100644 --- a/Nasal/canvas/map/altitude-profile.draw +++ b/Nasal/canvas/map/altitude-profile.draw @@ -26,7 +26,7 @@ var drawprofile = func (group, property, disptext) .setTranslation(25,35) .setColor(0.195,0.96,0.097); sym_group.setGeoPosition(lat, lon) - .set("z-index",4); + .set("z-index",3); } } diff --git a/Nasal/canvas/map/fix.draw b/Nasal/canvas/map/fix.draw index 5a8cb955b..986ea2cf8 100644 --- a/Nasal/canvas/map/fix.draw +++ b/Nasal/canvas/map/fix.draw @@ -29,6 +29,6 @@ var draw_fix = func (group, fix, controller=nil, lod=0) { # the fix position fix_grp.setGeoPosition(lat, lon) - .set("z-index",3); + .set("z-index",-3); } diff --git a/Nasal/canvas/map/navdisplay.mfd b/Nasal/canvas/map/navdisplay.mfd index 6a76e2848..9b07261c8 100644 --- a/Nasal/canvas/map/navdisplay.mfd +++ b/Nasal/canvas/map/navdisplay.mfd @@ -31,24 +31,16 @@ NDSourceDriver.new = func { m.get_trk_mag= func { if(getprop("/velocities/groundspeed-kt") > 80) - { getprop("/orientation/track-magnetic-deg"); - } else - { getprop("/orientation/heading-magnetic-deg"); - } }; m.get_trk_tru = func { if(getprop("/velocities/groundspeed-kt") > 80) - { getprop("/orientation/track-deg"); - } else - { getprop("/orientation/heading-deg"); - } }; m.get_lat= func getprop("/position/latitude-deg"); m.get_lon= func getprop("/position/longitude-deg"); @@ -242,16 +234,14 @@ var NavDisplay = { # because things are much better configurable that way # now look up all required SVG elements and initialize member fields using the same name to have a convenient handle foreach(var element; ["dmeLDist","dmeRDist","dmeL","dmeR","vorL","vorR","vorLId","vorRId", - "range","status.wxr","status.wpt","status.sta","status.arpt"]) + "status.wxr","status.wpt","status.sta","status.arpt"]) me.symbols[element] = me.nd.getElementById(element); # load elements from vector image, and create instance variables using identical names, and call updateCenter() on each # anything that needs updatecenter called, should be added to the vector here # - foreach(var element; ["compassApp","northUp","aplSymMap","aplSymMapCtr","aplSymVor", - "staArrowL2","staArrowR2","staFromL2","staToL2","staFromR2","staToR2", - "hdgTrk","truMag","altArc","planArcs", - "trkInd","compass","hdgBug","HdgBugCRT","TrkBugLCD","HdgBugLCD","curHdgPtr", + foreach(var element; ["staArrowL2","staArrowR2","staFromL2","staToL2","staFromR2","staToR2", + "hdgTrk","trkInd","hdgBug","HdgBugCRT","TrkBugLCD","HdgBugLCD","curHdgPtr", "HdgBugCRT2","TrkBugLCD2","HdgBugLCD2","hdgBug2","selHdgLine","selHdgLine2","curHdgPtr2", "staArrowL","staArrowR","staToL","staFromL","staToR","staFromR"] ) me.symbols[element] = me.nd.getElementById(element).updateCenter(); @@ -417,13 +407,15 @@ var NavDisplay = { var userTrkTru = me.aircraft_source.get_trk_tru(); if(me.get_switch('toggle_true_north')) { - me.symbols.truMag.setText("TRU"); var userHdg=userHdgTru; + me.userHdg=userHdgTru; var userTrk=userTrkTru; + me.userTrk=userTrkTru; } else { - me.symbols.truMag.setText("MAG"); var userHdg=userHdgMag; + me.userHdg=userHdgMag; var userTrk=userTrkMag; + me.userTrk=userTrkMag; } # this should only ever happen when testing the experimental AI/MP ND driver hash (not critical) # or when an error occurs (critical) @@ -431,17 +423,21 @@ var NavDisplay = { print("aircraft source invalid, returning !"); return; } - if (me.aircraft_source.get_gnd_spd() < 80) + if (me.aircraft_source.get_gnd_spd() < 80) { userTrk = userHdg; + me.userTrk=userHdg; + } if((me.in_mode('toggle_display_mode', ['MAP']) and me.get_switch('toggle_display_type') == "CRT") or (me.get_switch('toggle_track_heading') and me.get_switch('toggle_display_type') == "LCD")) { userHdgTrk = userTrk; + me.userHdgTrk = userTrk; userHdgTrkTru = userTrkTru; me.symbols.hdgTrk.setText("TRK"); } else { userHdgTrk = userHdg; + me.userHdgTrk = userHdg; userHdgTrkTru = userHdgTru; me.symbols.hdgTrk.setText("HDG"); } @@ -562,8 +558,6 @@ var NavDisplay = { me.symbols.dmeRDist.setText(""); } - me.symbols.range.setText(sprintf("%3.0f",me.rangeNm()/2)); - # Hide heading bug 10 secs after change var vhdg_bug = getprop("autopilot/settings/heading-bug-deg") or 0; var hdg_bug_active = getprop("autopilot/settings/heading-bug-active"); @@ -574,14 +568,12 @@ var NavDisplay = { or (me.get_switch('toggle_track_heading') and me.get_switch('toggle_display_type') == "LCD")) { me.symbols.trkInd.setRotation(0); - me.symbols.trkInd2.setRotation(0); me.symbols.curHdgPtr.setRotation((userHdg-userTrk)*D2R); me.symbols.curHdgPtr2.setRotation((userHdg-userTrk)*D2R); } else { me.symbols.trkInd.setRotation((userTrk-userHdg)*D2R); - me.symbols.trkInd2.setRotation((userTrk-userHdg)*D2R); me.symbols.curHdgPtr.setRotation(0); me.symbols.curHdgPtr2.setRotation(0); } @@ -592,22 +584,6 @@ var NavDisplay = { me.symbols.hdgBug.setRotation(hdgBugRot); me.symbols.hdgBug2.setRotation(hdgBugRot); me.symbols.selHdgLine2.setRotation(hdgBugRot); - me.symbols.compass.setRotation(-userHdgTrk*D2R); - me.symbols.compassApp.setRotation(-userHdgTrk*D2R); - } - if(me.get_switch('toggle_centered')) { - if (me.in_mode('toggle_display_mode', ['APP','VOR'])) - me.symbols.compassApp.show(); - else - me.symbols.compassApp.setVisible(me.in_mode('toggle_display_mode', ['MAP'])); - } else { - me.symbols.compassApp.hide(); - } - - if ((me.get_switch('toggle_centered') and !me.in_mode('toggle_display_mode', ['PLAN'])) or me.in_mode('toggle_display_mode', ['PLAN'])) { - me.symbols.compass.hide(); - } else { - me.symbols.compass.show(); } var staPtrVis = !me.in_mode('toggle_display_mode', ['PLAN']); @@ -622,139 +598,113 @@ var NavDisplay = { var vorheading = userHdgTru; var adfheading = userHdgMag; } - if(me.in_mode('toggle_display_mode', ['APP','MAP','VOR','PLAN'])) + if(getprop("instrumentation/nav/heading-deg") != nil) + var nav0hdg=getprop("instrumentation/nav/heading-deg") - vorheading; + if(getprop("instrumentation/nav[1]/heading-deg") != nil) + var nav1hdg=getprop("instrumentation/nav[1]/heading-deg") - vorheading; + var adf0hdg=getprop("instrumentation/adf/indicated-bearing-deg"); + var adf1hdg=getprop("instrumentation/adf[1]/indicated-bearing-deg"); + if(!me.get_switch('toggle_centered')) { - if(getprop("instrumentation/nav/heading-deg") != nil) - var nav0hdg=getprop("instrumentation/nav/heading-deg") - vorheading; - if(getprop("instrumentation/nav[1]/heading-deg") != nil) - var nav1hdg=getprop("instrumentation/nav[1]/heading-deg") - vorheading; - var adf0hdg=getprop("instrumentation/adf/indicated-bearing-deg") - adfheading; - var adf1hdg=getprop("instrumentation/adf[1]/indicated-bearing-deg") - adfheading; - if(!me.get_switch('toggle_centered')) - { - if(me.in_mode('toggle_display_mode', ['PLAN'])) - me.symbols.trkInd.hide(); - else - me.symbols.trkInd.show(); - if((getprop("instrumentation/nav/in-range") and me.get_switch('toggle_lh_vor_adf') == 1)) { - me.symbols.staArrowL.setVisible(staPtrVis); - me.symbols.staToL.setColor(0.195,0.96,0.097); - me.symbols.staFromL.setColor(0.195,0.96,0.097); - me.symbols.staArrowL.setRotation(nav0hdg*D2R); - } - elsif(getprop("instrumentation/adf/in-range") and (me.get_switch('toggle_lh_vor_adf') == -1)) { - me.symbols.staArrowL.setVisible(staPtrVis); - me.symbols.staToL.setColor(0,0.6,0.85); - me.symbols.staFromL.setColor(0,0.6,0.85); - me.symbols.staArrowL.setRotation(adf0hdg*D2R); - } else { - me.symbols.staArrowL.hide(); - } - if((getprop("instrumentation/nav[1]/in-range") and me.get_switch('toggle_rh_vor_adf') == 1)) { - me.symbols.staArrowR.setVisible(staPtrVis); - me.symbols.staToR.setColor(0.195,0.96,0.097); - me.symbols.staFromR.setColor(0.195,0.96,0.097); - me.symbols.staArrowR.setRotation(nav1hdg*D2R); - } elsif(getprop("instrumentation/adf[1]/in-range") and (me.get_switch('toggle_rh_vor_adf') == -1)) { - me.symbols.staArrowR.setVisible(staPtrVis); - me.symbols.staToR.setColor(0,0.6,0.85); - me.symbols.staFromR.setColor(0,0.6,0.85); - me.symbols.staArrowR.setRotation(adf1hdg*D2R); - } else { - me.symbols.staArrowR.hide(); - } - me.symbols.staArrowL2.hide(); - me.symbols.staArrowR2.hide(); - me.symbols.curHdgPtr2.hide(); - me.symbols.HdgBugCRT2.hide(); - me.symbols.TrkBugLCD2.hide(); - me.symbols.HdgBugLCD2.hide(); - me.symbols.selHdgLine2.hide(); - me.symbols.curHdgPtr.setVisible(staPtrVis); - me.symbols.HdgBugCRT.setVisible(staPtrVis and !dispLCD); - if(me.get_switch('toggle_track_heading')) - { - me.symbols.HdgBugLCD.hide(); - me.symbols.TrkBugLCD.setVisible(staPtrVis and dispLCD); - } - else - { - me.symbols.TrkBugLCD.hide(); - me.symbols.HdgBugLCD.setVisible(staPtrVis and dispLCD); - } - me.symbols.selHdgLine.setVisible(staPtrVis and hdg_bug_active); - } else { + if(me.in_mode('toggle_display_mode', ['PLAN'])) me.symbols.trkInd.hide(); - if((getprop("instrumentation/nav/in-range") and me.get_switch('toggle_lh_vor_adf') == 1)) { - me.symbols.staArrowL2.setVisible(staPtrVis); - me.symbols.staFromL2.setColor(0.195,0.96,0.097); - me.symbols.staToL2.setColor(0.195,0.96,0.097); - me.symbols.staArrowL2.setRotation(nav0hdg*D2R); - } elsif(getprop("instrumentation/adf/in-range") and (me.get_switch('toggle_lh_vor_adf') == -1)) { - me.symbols.staArrowL2.setVisible(staPtrVis); - me.symbols.staFromL2.setColor(0,0.6,0.85); - me.symbols.staToL2.setColor(0,0.6,0.85); - me.symbols.staArrowL2.setRotation(adf0hdg*D2R); - } else { - me.symbols.staArrowL2.hide(); - } - if((getprop("instrumentation/nav[1]/in-range") and me.get_switch('toggle_rh_vor_adf') == 1)) { - me.symbols.staArrowR2.setVisible(staPtrVis); - me.symbols.staFromR2.setColor(0.195,0.96,0.097); - me.symbols.staToR2.setColor(0.195,0.96,0.097); - me.symbols.staArrowR2.setRotation(nav1hdg*D2R); - } elsif(getprop("instrumentation/adf[1]/in-range") and (me.get_switch('toggle_rh_vor_adf') == -1)) { - me.symbols.staArrowR2.setVisible(staPtrVis); - me.symbols.staFromR2.setColor(0,0.6,0.85); - me.symbols.staToR2.setColor(0,0.6,0.85); - me.symbols.staArrowR2.setRotation(adf1hdg*D2R); - } else { - me.symbols.staArrowR2.hide(); - } - me.symbols.staArrowL.hide(); - me.symbols.staArrowR.hide(); - me.symbols.curHdgPtr.hide(); - me.symbols.HdgBugCRT.hide(); - me.symbols.TrkBugLCD.hide(); - me.symbols.HdgBugLCD.hide(); - me.symbols.selHdgLine.hide(); - me.symbols.curHdgPtr2.setVisible(staPtrVis); - me.symbols.HdgBugCRT2.setVisible(staPtrVis and !dispLCD); - if(me.get_switch('toggle_track_heading')) - { - me.symbols.HdgBugLCD2.hide(); - me.symbols.TrkBugLCD2.setVisible(staPtrVis and dispLCD); - } - else - { - me.symbols.TrkBugLCD2.hide(); - me.symbols.HdgBugLCD2.setVisible(staPtrVis and dispLCD); - } - me.symbols.selHdgLine2.setVisible(staPtrVis and hdg_bug_active); + else + me.symbols.trkInd.show(); + if((getprop("instrumentation/nav/in-range") and me.get_switch('toggle_lh_vor_adf') == 1)) { + me.symbols.staArrowL.setVisible(staPtrVis); + me.symbols.staToL.setColor(0.195,0.96,0.097); + me.symbols.staFromL.setColor(0.195,0.96,0.097); + me.symbols.staArrowL.setRotation(nav0hdg*D2R); } - } - - me.symbols.northUp.setVisible(me.in_mode('toggle_display_mode', ['PLAN'])); - me.symbols.aplSymMap.setVisible(me.in_mode('toggle_display_mode', ['APP','MAP','VOR']) and !me.get_switch('toggle_centered')); - me.symbols.aplSymMapCtr.setVisible(me.in_mode('toggle_display_mode', ['MAP']) and me.get_switch('toggle_centered')); - me.symbols.aplSymVor.setVisible(me.in_mode('toggle_display_mode', ['APP','VOR']) and me.get_switch('toggle_centered')); - me.symbols.planArcs.setVisible(me.in_mode('toggle_display_mode', ['PLAN'])); - - if (abs(userVSpd) > 5) { - var altDiff = (getprop("autopilot/settings/target-altitude-ft") or 0)-(getprop("instrumentation/altimeter/indicated-altitude-ft") or 0); - if (abs(altDiff) > 50 and altDiff/userVSpd > 0) { - var altRangeNm = altDiff/userVSpd*userGndSpd*KT2MPS*M2NM; - if(altRangeNm > 1) { - var altRangePx = (350/me.rangeNm())*altRangeNm; - if (altRangePx > 700) - altRangePx = 700; - me.symbols.altArc.setTranslation(0,-altRangePx); - } - me.symbols.altArc.setVisible(me.in_mode('toggle_display_mode', ['MAP']) and !me.get_switch('toggle_centered')); - } else - me.symbols.altArc.hide(); + elsif(getprop("instrumentation/adf/in-range") and (me.get_switch('toggle_lh_vor_adf') == -1)) { + me.symbols.staArrowL.setVisible(staPtrVis); + me.symbols.staToL.setColor(0,0.6,0.85); + me.symbols.staFromL.setColor(0,0.6,0.85); + me.symbols.staArrowL.setRotation(adf0hdg*D2R); + } else { + me.symbols.staArrowL.hide(); + } + if((getprop("instrumentation/nav[1]/in-range") and me.get_switch('toggle_rh_vor_adf') == 1)) { + me.symbols.staArrowR.setVisible(staPtrVis); + me.symbols.staToR.setColor(0.195,0.96,0.097); + me.symbols.staFromR.setColor(0.195,0.96,0.097); + me.symbols.staArrowR.setRotation(nav1hdg*D2R); + } elsif(getprop("instrumentation/adf[1]/in-range") and (me.get_switch('toggle_rh_vor_adf') == -1)) { + me.symbols.staArrowR.setVisible(staPtrVis); + me.symbols.staToR.setColor(0,0.6,0.85); + me.symbols.staFromR.setColor(0,0.6,0.85); + me.symbols.staArrowR.setRotation(adf1hdg*D2R); + } else { + me.symbols.staArrowR.hide(); + } + me.symbols.staArrowL2.hide(); + me.symbols.staArrowR2.hide(); + me.symbols.curHdgPtr2.hide(); + me.symbols.HdgBugCRT2.hide(); + me.symbols.TrkBugLCD2.hide(); + me.symbols.HdgBugLCD2.hide(); + me.symbols.selHdgLine2.hide(); + me.symbols.curHdgPtr.setVisible(staPtrVis); + me.symbols.HdgBugCRT.setVisible(staPtrVis and !dispLCD); + if(me.get_switch('toggle_track_heading')) + { + me.symbols.HdgBugLCD.hide(); + me.symbols.TrkBugLCD.setVisible(staPtrVis and dispLCD); + } + else + { + me.symbols.TrkBugLCD.hide(); + me.symbols.HdgBugLCD.setVisible(staPtrVis and dispLCD); + } + me.symbols.selHdgLine.setVisible(staPtrVis and hdg_bug_active); } else { - me.symbols.altArc.hide(); + me.symbols.trkInd.hide(); + if((getprop("instrumentation/nav/in-range") and me.get_switch('toggle_lh_vor_adf') == 1)) { + me.symbols.staArrowL2.setVisible(staPtrVis); + me.symbols.staFromL2.setColor(0.195,0.96,0.097); + me.symbols.staToL2.setColor(0.195,0.96,0.097); + me.symbols.staArrowL2.setRotation(nav0hdg*D2R); + } elsif(getprop("instrumentation/adf/in-range") and (me.get_switch('toggle_lh_vor_adf') == -1)) { + me.symbols.staArrowL2.setVisible(staPtrVis); + me.symbols.staFromL2.setColor(0,0.6,0.85); + me.symbols.staToL2.setColor(0,0.6,0.85); + me.symbols.staArrowL2.setRotation(adf0hdg*D2R); + } else { + me.symbols.staArrowL2.hide(); + } + if((getprop("instrumentation/nav[1]/in-range") and me.get_switch('toggle_rh_vor_adf') == 1)) { + me.symbols.staArrowR2.setVisible(staPtrVis); + me.symbols.staFromR2.setColor(0.195,0.96,0.097); + me.symbols.staToR2.setColor(0.195,0.96,0.097); + me.symbols.staArrowR2.setRotation(nav1hdg*D2R); + } elsif(getprop("instrumentation/adf[1]/in-range") and (me.get_switch('toggle_rh_vor_adf') == -1)) { + me.symbols.staArrowR2.setVisible(staPtrVis); + me.symbols.staFromR2.setColor(0,0.6,0.85); + me.symbols.staToR2.setColor(0,0.6,0.85); + me.symbols.staArrowR2.setRotation(adf1hdg*D2R); + } else { + me.symbols.staArrowR2.hide(); + } + me.symbols.staArrowL.hide(); + me.symbols.staArrowR.hide(); + me.symbols.curHdgPtr.hide(); + me.symbols.HdgBugCRT.hide(); + me.symbols.TrkBugLCD.hide(); + me.symbols.HdgBugLCD.hide(); + me.symbols.selHdgLine.hide(); + me.symbols.curHdgPtr2.setVisible(staPtrVis); + me.symbols.HdgBugCRT2.setVisible(staPtrVis and !dispLCD); + if(me.get_switch('toggle_track_heading')) + { + me.symbols.HdgBugLCD2.hide(); + me.symbols.TrkBugLCD2.setVisible(staPtrVis and dispLCD); + } + else + { + me.symbols.TrkBugLCD2.hide(); + me.symbols.HdgBugLCD2.setVisible(staPtrVis and dispLCD); + } + me.symbols.selHdgLine2.setVisible(staPtrVis and hdg_bug_active); } ## run all predicates in the NDStyle hash and evaluate their true/false behavior callbacks diff --git a/Nasal/canvas/map/navdisplay.styles b/Nasal/canvas/map/navdisplay.styles index 3667e1f3e..0f808784c 100644 --- a/Nasal/canvas/map/navdisplay.styles +++ b/Nasal/canvas/map/navdisplay.styles @@ -319,6 +319,38 @@ var NDStyles = { is_false: func(nd) nd.symbols.gsGroup.hide(), }, }, + { + id: 'compassApp', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.get_switch('toggle_centered') and nd.in_mode('toggle_display_mode', ['APP','VOR'])), + is_true: func(nd) { + if(nd.get_switch('toggle_true_north')) + var hdg = nd.aircraft_source.get_trk_tru(); + else + var hdg = nd.aircraft_source.get_trk_mag(); + nd.symbols.compassApp.setRotation(-hdg*D2R); + nd.symbols.compassApp.show(); + }, + is_false: func(nd) nd.symbols.compassApp.hide(), + }, + }, + { + id: 'compassMapCtr', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.get_switch('toggle_centered') and nd.in_mode('toggle_display_mode', ['MAP'])), + is_true: func(nd) { + if(nd.get_switch('toggle_true_north')) + var hdg = nd.aircraft_source.get_trk_tru(); + else + var hdg = nd.aircraft_source.get_trk_mag(); + nd.symbols.compassMapCtr.setRotation(-hdg*D2R); + nd.symbols.compassMapCtr.show(); + }, + is_false: func(nd) nd.symbols.compassMapCtr.hide(), + }, + }, { id:'hdg', impl: { @@ -373,6 +405,72 @@ var NDStyles = { is_false: func(nd) nd.symbols.gs.setFontSize(52), }, }, + { + id:'compass', + impl: { + init: func(nd,symbol), + predicate: func(nd) ((nd.get_switch('toggle_centered') and !nd.in_mode('toggle_display_mode', ['PLAN'])) or nd.in_mode('toggle_display_mode', ['PLAN'])), + is_true: func(nd) nd.symbols.compass.hide(), + is_false: func(nd) { + nd.symbols.compass.show(); + nd.symbols.compass.setRotation(-nd.userHdgTrk*D2R); + }, + }, + }, + { + id:'truMag', + impl: { + init: func(nd,symbol), + predicate: func(nd) nd.get_switch('toggle_true_north'), + is_true: func(nd) nd.symbols.truMag.setText("TRU"), + is_false: func(nd) nd.symbols.truMag.setText("MAG"), + }, + }, + { + id:'northUp', + impl: { + init: func(nd,symbol), + predicate: func(nd) nd.in_mode('toggle_display_mode', ['PLAN']), + is_true: func(nd) nd.symbols.northUp.show(), + is_false: func(nd) nd.symbols.northUp.hide(), + }, + }, + { + id:'planArcs', + impl: { + init: func(nd,symbol), + predicate: func(nd) nd.in_mode('toggle_display_mode', ['PLAN']), + is_true: func(nd) nd.symbols.planArcs.show(), + is_false: func(nd) nd.symbols.planArcs.hide(), + }, + }, + { + id:'aplSymMap', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.in_mode('toggle_display_mode', ['APP','MAP','VOR']) and !nd.get_switch('toggle_centered')), + is_true: func(nd) nd.symbols.aplSymMap.show(), + is_false: func(nd) nd.symbols.aplSymMap.hide(), + }, + }, + { + id:'aplSymMapCtr', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.in_mode('toggle_display_mode', ['MAP']) and nd.get_switch('toggle_centered')), + is_true: func(nd) nd.symbols.aplSymMapCtr.show(), + is_false: func(nd) nd.symbols.aplSymMapCtr.hide(), + }, + }, + { + id:'aplSymVor', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.in_mode('toggle_display_mode', ['APP','VOR']) and nd.get_switch('toggle_centered')), + is_true: func(nd) nd.symbols.aplSymVor.show(), + is_false: func(nd) nd.symbols.aplSymVor.hide(), + }, + }, { id:'rangeArcs', impl: { @@ -380,8 +478,8 @@ var NDStyles = { predicate: func(nd) !nd.get_switch('toggle_centered') and nd.get_switch('toggle_rangearc'), is_true: func(nd) nd.symbols.rangeArcs.show(), is_false: func(nd) nd.symbols.rangeArcs.hide(), - }, # of rangeArcs.impl - }, # of rangeArcs + }, + }, { id:'rangePln1', impl: { @@ -430,6 +528,85 @@ var NDStyles = { is_false: func(nd) nd.symbols.rangePln4.hide(), }, }, + { + id:'range', + impl: { + init: func(nd,symbol), + predicate: func(nd) !nd.get_switch('toggle_centered'), + is_true: func(nd) { + nd.symbols.range.setText(sprintf("%3.0f",nd.rangeNm()/2)); + }, + is_false: func(nd) nd.symbols.rangePln4.hide(), + }, + }, + { + id:'rangeCtr1', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.get_switch('toggle_centered') and nd.in_mode('toggle_display_mode', ['APP','MAP','VOR'])), + is_true: func(nd) { + nd.symbols.rangeCtr1.show(); + nd.symbols.rangeCtr1.setText(sprintf("%3.1f",nd.rangeNm()/4)); + }, + is_false: func(nd) nd.symbols.rangeCtr1.hide(), + }, + }, + { + id:'rangeCtr2', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.get_switch('toggle_centered') and nd.in_mode('toggle_display_mode', ['APP','MAP','VOR'])), + is_true: func(nd) { + nd.symbols.rangeCtr2.show(); + nd.symbols.rangeCtr2.setText(sprintf("%3.1f",nd.rangeNm()/4)); + }, + is_false: func(nd) nd.symbols.rangeCtr2.hide(), + }, + }, + { + id:'altArc', + impl: { + init: func(nd,symbol), + predicate: func(nd) (!nd.get_switch('toggle_centered') and nd.in_mode('toggle_display_mode', ['MAP'])), + is_true: func(nd) { + var altDiff = (getprop("autopilot/settings/target-altitude-ft") or 0)-(getprop("instrumentation/altimeter/indicated-altitude-ft") or 0); + if (abs(altDiff) > 50 and altDiff/nd.aircraft_source.get_vspd() > 0) { + var altRangeNm = altDiff/nd.aircraft_source.get_vspd()*nd.aircraft_source.get_gnd_spd()*KT2MPS*M2NM; + if(altRangeNm > 1) { + var altRangePx = (350/nd.rangeNm())*altRangeNm; + if (altRangePx > 700) + altRangePx = 700; + nd.symbols.altArc.setTranslation(0,-altRangePx); + } + nd.symbols.altArc.show(); + } else + nd.symbols.altArc.hide(); + }, + is_false: func(nd) nd.symbols.altArc.hide(), + }, + }, + { + id:'altArcCtr', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.get_switch('toggle_centered') and nd.in_mode('toggle_display_mode', ['MAP'])), + is_true: func(nd) { + var altDiff = (getprop("autopilot/settings/target-altitude-ft") or 0)-(getprop("instrumentation/altimeter/indicated-altitude-ft") or 0); + if (abs(altDiff) > 50 and altDiff/nd.aircraft_source.get_vspd() > 0) { + var altRangeNm = altDiff/nd.aircraft_source.get_vspd()*nd.aircraft_source.get_gnd_spd()*KT2MPS*M2NM; + if(altRangeNm > 1) { + var altRangePx = (175/nd.rangeNm())*altRangeNm; + if (altRangePx > 350) + altRangePx = 350; + nd.symbols.altArcCtr.setTranslation(0,-altRangePx); + } + nd.symbols.altArcCtr.show(); + } else + nd.symbols.altArcCtr.hide(); + }, + is_false: func(nd) nd.symbols.altArcCtr.hide(), + }, + }, { id:'crsLbl', impl: { @@ -478,13 +655,32 @@ var NDStyles = { id:'trkInd2', impl: { init: func(nd,symbol), - predicate: func(nd) (nd.in_mode('toggle_display_mode', ['MAP','APP','VOR']) and nd.get_switch('toggle_centered')), + predicate: func(nd) (nd.in_mode('toggle_display_mode', ['APP','VOR']) and nd.get_switch('toggle_centered')), is_true: func(nd) { + if (nd.get_switch('toggle_track_heading') and nd.get_switch('toggle_display_type') == "LCD") + nd.symbols.trkInd2.setRotation(0); + else + nd.symbols.trkInd2.setRotation((nd.userTrk-nd.userHdg)*D2R); nd.symbols.trkInd2.show(); }, is_false: func(nd) nd.symbols.trkInd2.hide(), }, }, + { + id:'trkIndMapCtr', + impl: { + init: func(nd,symbol), + predicate: func(nd) (nd.in_mode('toggle_display_mode', ['MAP']) and nd.get_switch('toggle_centered')), + is_true: func(nd) { + if (nd.get_switch('toggle_display_type') == "CRT" or (nd.get_switch('toggle_track_heading') and nd.get_switch('toggle_display_type') == "LCD")) + nd.symbols.trkIndMapCtr.setRotation(0); + else + nd.symbols.trkIndMapCtr.setRotation((nd.userTrk-nd.userHdg)*D2R); + nd.symbols.trkIndMapCtr.show(); + }, + is_false: func(nd) nd.symbols.trkIndMapCtr.hide(), + }, + }, { id:'vorCrsPtr', impl: { @@ -572,7 +768,7 @@ var NDStyles = { id:'wind', impl: { init: func(nd,symbol), - predicate: ALWAYS, + predicate: func(nd) (nd.aircraft_source.get_spd() > 100 and getprop("environment/wind-speed-kt") > 6), is_true: func(nd) { var windDir = getprop("environment/wind-from-heading-deg"); if(!nd.get_switch('toggle_true_north')) @@ -580,15 +776,16 @@ var NDStyles = { if(windDir < 0.5) windDir = 360 + windDir; elsif(windDir >= 360.5) windDir = windDir - 360; nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,getprop("environment/wind-speed-kt"))); + nd.symbols.wind.show(); }, - is_false: NOTHING, + is_false: func(nd) nd.symbols.wind.hide(), }, }, { id:'windArrow', impl: { init: func(nd,symbol), - predicate: func(nd) (!(nd.in_mode('toggle_display_mode', ['PLAN']) and (nd.get_switch('toggle_display_type') == "LCD")) and nd.aircraft_source.get_spd() > 100), + predicate: func(nd) (!(nd.in_mode('toggle_display_mode', ['PLAN']) and (nd.get_switch('toggle_display_type') == "LCD")) and nd.aircraft_source.get_spd() > 100 and getprop("environment/wind-speed-kt") > 6), is_true: func(nd) { nd.symbols.windArrow.show(); var windArrowRot = getprop("environment/wind-from-heading-deg"); diff --git a/Nasal/canvas/map/navdisplayLayers.txt b/Nasal/canvas/map/navdisplayLayers.txt new file mode 100644 index 000000000..1879ba865 --- /dev/null +++ b/Nasal/canvas/map/navdisplayLayers.txt @@ -0,0 +1,11 @@ +From top to bottom: + + 4 TCAS + 3 Altitude profile (T/C, T/D etc.) + 2 Waypoint + 1 Route + 0 Map overlay (range, track) +-1 Airports +-2 Stations +-3 Fixes +-4 Weather radar \ No newline at end of file diff --git a/Nasal/canvas/map/route.draw b/Nasal/canvas/map/route.draw index 695eea88e..0ad791759 100644 --- a/Nasal/canvas/map/route.draw +++ b/Nasal/canvas/map/route.draw @@ -28,7 +28,8 @@ var draw_route = func (group, theroute, controller=nil, lod=0) var route = route_group.createChild("path","route") .setStrokeLineWidth(5) - .setColor(1,0,1); + .setColor(1,0,1) + .set("z-index",1); var cmds = []; var coords = []; diff --git a/Nasal/canvas/map/traffic.draw b/Nasal/canvas/map/traffic.draw index e90d78aab..6e574e60e 100644 --- a/Nasal/canvas/map/traffic.draw +++ b/Nasal/canvas/map/traffic.draw @@ -77,7 +77,7 @@ var draw_traffic = func(group, traffic, lod=0) } tcas_grp.setGeoPosition(lat, lon) - .set("z-index",1); + .set("z-index",4); #settimer(func drawtraffic(group), 2); # updates are handled by the model, not by the view!