Showing 4 changed files with 150 additions and 51 deletions
+25 -6
Models/MapIcons.svg
... ...
@@ -67,11 +67,11 @@
67 67
      borderopacity="1.0"
68 68
      inkscape:pageopacity="0.0"
69 69
      inkscape:pageshadow="2"
70
-     inkscape:zoom="2.0000001"
71
-     inkscape:cx="329.97268"
72
-     inkscape:cy="350.78415"
70
+     inkscape:zoom="8.0000004"
71
+     inkscape:cx="185.58989"
72
+     inkscape:cy="138.73256"
73 73
      inkscape:document-units="px"
74
-     inkscape:current-layer="svg2"
74
+     inkscape:current-layer="Navaid_NDB"
75 75
      showgrid="true"
76 76
      inkscape:snap-object-midpoints="false"
77 77
      inkscape:window-width="1600"
... ...
@@ -156,9 +156,9 @@
156 156
        id="Navaid_Height2"
157 157
        inkscape:connector-curvature="0" />
158 158
     <g
159
-       id="Navaid_NDB"
159
+       id="Navaid_NDB_old"
160 160
        transform="translate(-92.533343,-1.8666667)"
161
-       inkscape:label="Navaid_NDB">
161
+       inkscape:label="Navaid_NDB_old">
162 162
       <circle
163 163
          id="path3586"
164 164
          style="fill:none;stroke:#c87137;stroke-width:1.06666672;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
... ...
@@ -546,6 +546,25 @@
546 546
          cy="-387.90564"
547 547
          r="0.66666657" />
548 548
     </g>
549
+    <g
550
+       id="Navaid_NDB"
551
+       inkscape:label="Navaid_NDB">
552
+      <path
553
+         style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.75748026;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.87874013, 0.87874012999999984;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
554
+         d="m 196.22266,391.65625 -0.27344,0.0137 0.0879,1.75391 0.22851,-0.0117 0.56055,0.0293 0.0879,-1.75586 -0.60351,-0.0293 -0.043,-0.002 z m -1.37891,0.13867 -0.043,0.006 -0.043,0.0117 -0.61328,0.1582 -0.043,0.01 -0.041,0.0156 -0.0937,0.0352 0.60351,1.65039 0.0625,-0.0234 0.51953,-0.13281 0.0996,-0.0156 -0.26367,-1.73633 z m 2.67383,1.76563 0.38476,0.0996 0.36914,0.13476 0.60547,-1.65039 -0.40429,-0.14844 -0.041,-0.0156 -0.043,-0.01 -0.43359,-0.11132 z m -4.6836,-1.04688 -0.0371,0.0195 -0.0371,0.0215 -0.52149,0.3164 0.91211,1.50196 0.48047,-0.29102 0.20703,-0.10156 -0.76172,-1.58203 z m 6.08008,1.57617 0.43555,0.26368 0.22851,0.16992 1.05274,-1.40625 -0.25977,-0.19531 -0.0332,-0.0254 -0.0371,-0.0215 -0.47461,-0.28711 z m -7.76367,-0.33203 -0.0312,0.0274 -0.0273,0.0312 -0.35157,0.38671 1.30079,1.18165 0.3125,-0.34571 0.24218,-0.2207 -1.18164,-1.30078 z m 9.42969,0.84375 -0.4375,0.39649 0.38672,0.42773 0.11523,0.15234 1.40625,-1.05273 -0.14258,-0.18945 -0.0234,-0.0332 -0.0293,-0.0312 -0.41211,-0.45507 -0.0293,-0.0312 -0.0312,-0.0274 -0.0195,-0.0176 z m -10.69141,0.82422 -0.0234,0.0371 -0.0176,0.0391 -0.1875,0.38867 1.58398,0.76368 0.16797,-0.35157 0.20898,-0.3457 -1.50195,-0.91211 z m 11.19336,0.81445 0.0488,0.0781 0.22461,0.4707 0.0312,0.0879 1.65039,-0.60351 -0.0488,-0.13282 -0.0137,-0.041 -0.0195,-0.0391 -0.26953,-0.5586 -0.0176,-0.0391 -0.0234,-0.0371 -0.0606,-0.0996 z m -11.93555,1.1836 -0.0117,0.043 -0.006,0.0449 -0.0469,0.30469 1.73633,0.26562 0.0391,-0.25781 0.13281,-0.51367 -1.70312,-0.4375 z m 12.48047,0.20703 0.0488,0.18945 0.0879,0.58789 1.73828,-0.26562 -0.0957,-0.63086 -0.008,-0.0449 -0.01,-0.043 -0.0605,-0.23047 z m -12.63867,1.25781 -0.002,0.0449 0.002,0.0449 0.0332,0.65429 0.002,0.043 0.008,0.0449 0.0176,0.11133 1.73633,-0.26562 -0.01,-0.0625 -0.0293,-0.57032 0.004,-0.0664 -1.75586,-0.0879 z m 12.76953,0.61524 -0.0273,0.17187 1.73828,0.26563 0.0332,-0.22071 0.008,-0.0449 0.002,-0.043 0.0332,-0.65429 -1.75586,-0.0899 z m -12.52539,1.27734 0.0703,0.27344 0.0117,0.043 0.0156,0.041 0.20312,0.5586 1.65039,-0.60352 -0.1875,-0.51758 -0.0605,-0.23437 z m 12.30078,-0.18945 -0.17968,0.48632 -0.0156,0.0352 0.004,0.002 -0.004,0.008 0.082,0.0293 1.50196,0.72461 0.0332,-0.0703 0.0195,-0.0391 0.0137,-0.041 0.2168,-0.58789 0.0137,-0.041 0.0117,-0.043 0.043,-0.16797 -1.70313,-0.4375 z m -11.52734,2.04101 0.20312,0.33594 0.0215,0.0352 0.0254,0.0332 0.29297,0.39062 1.40625,-1.05078 -0.26172,-0.35156 -0.18555,-0.30469 z m 10.83594,-0.60937 -0.33008,0.4414 1.4082,1.05274 0.35742,-0.48047 0.0254,-0.0332 0.0215,-0.0352 0.14648,-0.24023 -1.50195,-0.91407 z m -9.58985,2.17773 0.35352,0.32031 0.0312,0.0293 0.0332,0.0254 0.32031,0.24024 1.05274,-1.40821 -0.2832,-0.21289 -0.32618,-0.29492 z m 8.52149,-1.00586 -0.3711,0.2793 1.05078,1.4082 0.41016,-0.30664 0.0352,-0.0254 0.0293,-0.0293 0.27344,-0.24609 -1.18359,-1.30078 z m -6.89649,2.17774 0.51758,0.25 0.0391,0.0176 0.0391,0.0156 0.28711,0.10352 0.60546,-1.65039 -0.25,-0.0899 -0.47461,-0.23047 z m 5.53907,-1.35352 -0.34961,0.12891 0.60351,1.65039 0.39063,-0.14258 0.0391,-0.0156 0.0391,-0.0176 0.41797,-0.20117 -0.76367,-1.58399 z m -3.32618,0.44531 -0.40429,1.57032 0.0723,0.0195 0.043,0.01 0.043,0.008 0.63672,0.0976 0.043,0.006 0.0449,0.002 0.16016,0.008 0.0879,-1.75391 -0.11914,-0.008 -0.55079,-0.084 -0.0234,-0.006 v 0.002 l -0.0137,-0.002 z m 1.75196,-0.041 -0.23633,0.0117 0.0898,1.75586 0.26953,-0.0137 0.0449,-0.002 0.043,-0.006 0.60157,-0.0918 -0.26563,-1.73828 z"
555
+         id="path4598"
556
+         inkscape:connector-curvature="0" />
557
+      <path
558
+         style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#0000f4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.83449054;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.41724526, 1.41724526000000006;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
559
+         d="m 196.19626,387.20317 -0.44101,0.0221 0.14177,2.82874 0.36855,-0.0189 0.90406,0.0473 0.14177,-2.83188 -0.97335,-0.0472 -0.0694,-0.003 z m -2.22392,0.22365 -0.0694,0.01 -0.0694,0.0189 -0.9891,0.25515 -0.0693,0.0161 -0.0661,0.0252 -0.15112,0.0568 0.97335,2.66177 0.1008,-0.0377 0.83791,-0.21419 0.16063,-0.0252 -0.42525,-2.80038 z m 4.31239,2.84763 0.62055,0.16064 0.59535,0.21734 0.97651,-2.66177 -0.65204,-0.23941 -0.0661,-0.0252 -0.0694,-0.0161 -0.6993,-0.17954 z m -7.55378,-1.68842 -0.0598,0.0315 -0.0598,0.0347 -0.84107,0.5103 1.47107,2.42238 0.77491,-0.46936 0.3339,-0.1638 -1.22852,-2.55152 z m 9.80604,2.54207 0.70246,0.42527 0.36855,0.27405 1.69787,-2.26803 -0.41896,-0.31499 -0.0535,-0.041 -0.0598,-0.0347 -0.76546,-0.46305 z m -12.52136,-0.5355 -0.0503,0.0442 -0.044,0.0503 -0.56702,0.62369 2.09794,1.90578 0.504,-0.55756 0.39059,-0.35595 -1.90576,-2.09792 z m 15.20835,1.36081 -0.70561,0.63946 0.62371,0.68985 0.18584,0.2457 2.26802,-1.69786 -0.22995,-0.30555 -0.0377,-0.0535 -0.0473,-0.0503 -0.66466,-0.73395 -0.0472,-0.0503 -0.0503,-0.0442 -0.0314,-0.0284 z m -17.24327,1.32931 -0.0377,0.0598 -0.0284,0.0631 -0.3024,0.62685 2.55467,1.23168 0.2709,-0.56702 0.33705,-0.55755 -2.42237,-1.47107 z m 18.05282,1.31356 0.0787,0.12596 0.36226,0.75915 0.0503,0.14177 2.66177,-0.97335 -0.0787,-0.21421 -0.0221,-0.0661 -0.0315,-0.0631 -0.4347,-0.90092 -0.0284,-0.0631 -0.0377,-0.0598 -0.0977,-0.16063 z m -19.24984,1.90893 -0.0189,0.0694 -0.01,0.0724 -0.0756,0.49141 2.80037,0.4284 0.0631,-0.4158 0.21419,-0.82846 -2.74681,-0.7056 z m 20.12869,0.3339 0.0787,0.30555 0.14176,0.94815 2.80353,-0.42839 -0.15435,-1.01746 -0.0129,-0.0724 -0.0161,-0.0693 -0.0976,-0.3717 z m -20.38383,2.02861 -0.003,0.0724 0.003,0.0724 0.0535,1.05525 0.003,0.0694 0.0129,0.0724 0.0284,0.17955 2.80037,-0.42839 -0.0161,-0.1008 -0.0473,-0.91982 0.006,-0.10709 -2.83188,-0.14177 z m 20.59489,0.99227 -0.044,0.2772 2.80352,0.42841 0.0536,-0.35597 0.0129,-0.0724 0.003,-0.0693 0.0536,-1.05525 -2.83188,-0.14499 z m -20.20114,2.06012 0.11338,0.441 0.0189,0.0693 0.0252,0.0661 0.32759,0.90092 2.66178,-0.97337 -0.3024,-0.83476 -0.0976,-0.37799 z m 19.83888,-0.30555 -0.28979,0.78434 -0.0252,0.0568 0.006,0.003 -0.006,0.0129 0.13225,0.0473 2.42239,1.16866 0.0535,-0.11338 0.0315,-0.0631 0.0221,-0.0661 0.34965,-0.94816 0.0221,-0.0661 0.0189,-0.0694 0.0693,-0.27091 -2.74683,-0.7056 z m -18.59147,3.29177 0.3276,0.54181 0.0347,0.0568 0.041,0.0535 0.47251,0.63 2.26802,-1.69471 -0.42211,-0.567 -0.29926,-0.49141 z m 17.47637,-0.9828 -0.53236,0.71189 2.27117,1.69788 0.57645,-0.77491 0.041,-0.0535 0.0347,-0.0568 0.23625,-0.38744 -2.42237,-1.47423 z m -15.46665,3.51227 0.57016,0.5166 0.0503,0.0473 0.0535,0.041 0.51661,0.38746 1.69787,-2.27118 -0.45675,-0.34336 -0.52607,-0.47565 z m 13.74358,-1.62226 -0.59851,0.45046 1.69471,2.27116 0.66151,-0.49455 0.0568,-0.041 0.0472,-0.0473 0.44101,-0.3969 -1.90891,-2.09792 z m -11.12276,3.51229 0.83476,0.4032 0.0631,0.0284 0.0631,0.0252 0.46306,0.16696 0.97649,-2.66178 -0.4032,-0.14499 -0.76546,-0.3717 z m 8.9335,-2.18298 -0.56386,0.20791 0.97335,2.66177 0.63001,-0.22995 0.0631,-0.0252 0.0631,-0.0284 0.6741,-0.32445 -1.23165,-2.55468 z m -5.36452,0.7182 -0.65204,2.53264 0.11661,0.0315 0.0694,0.0161 0.0693,0.0129 1.02691,0.15741 0.0693,0.01 0.0724,0.003 0.2583,0.0129 0.14177,-2.82874 -0.19215,-0.0129 -0.88832,-0.13547 -0.0377,-0.01 v 0.003 l -0.0221,-0.003 z m 2.82559,-0.0661 -0.38116,0.0189 0.14484,2.83188 0.4347,-0.0221 0.0724,-0.003 0.0694,-0.01 0.97023,-0.14806 -0.42842,-2.80352 z"
560
+         id="path4598-7"
561
+         inkscape:connector-curvature="0" />
562
+      <path
563
+         style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#0000fc;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4.37820339;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:2.18910163, 2.18910163000000013;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
564
+         d="m 196.15838,380.82033 -0.68119,0.0341 0.21898,4.36932 0.56927,-0.0292 1.39643,0.0731 0.21898,-4.37417 -1.50345,-0.0729 -0.1072,-0.005 z m -3.4351,0.34545 -0.1072,0.0155 -0.10719,0.0292 -1.52778,0.39411 -0.10705,0.0249 -0.1021,0.0389 -0.23342,0.0877 1.50345,4.11142 0.1557,-0.0582 1.29425,-0.33084 0.24811,-0.0389 -0.65684,-4.32552 z m 6.66099,4.3985 0.95851,0.24813 0.91959,0.33571 1.50834,-4.11142 -1.00716,-0.3698 -0.1021,-0.0389 -0.10719,-0.0249 -1.08015,-0.27732 z m -11.6677,-2.60796 -0.0924,0.0487 -0.0924,0.0536 -1.29914,0.78822 2.27224,3.74165 1.19694,-0.72498 0.51575,-0.25301 -1.89759,-3.94112 z m 15.14658,3.92653 1.08503,0.65688 0.56927,0.4233 2.62256,-3.50324 -0.64713,-0.48654 -0.0826,-0.0633 -0.0924,-0.0536 -1.18234,-0.71523 z m -19.34071,-0.82715 -0.0777,0.0683 -0.068,0.0777 -0.87582,0.96336 3.24051,2.9437 0.77849,-0.86121 0.60331,-0.54981 -2.94367,-3.24048 z m 23.49108,2.10193 -1.08989,0.98772 0.96339,1.06556 0.28705,0.37951 3.50322,-2.62254 -0.35518,-0.47196 -0.0582,-0.0826 -0.0731,-0.0777 -1.02665,-1.13367 -0.0729,-0.0777 -0.0777,-0.0683 -0.0485,-0.0439 z m -26.63425,2.05328 -0.0582,0.0924 -0.0439,0.0975 -0.46709,0.96825 3.94598,1.90247 0.41844,-0.87583 0.52061,-0.8612 -3.74163,-2.27224 z m 27.8847,2.02895 0.12156,0.19456 0.55955,1.17259 0.0777,0.21898 4.11141,-1.50345 -0.12156,-0.33087 -0.0341,-0.1021 -0.0487,-0.0975 -0.67145,-1.39157 -0.0439,-0.0975 -0.0582,-0.0924 -0.15091,-0.24811 z m -29.73364,2.94856 -0.0292,0.1072 -0.0154,0.11183 -0.11677,0.75904 4.3255,0.66171 0.0975,-0.64225 0.33085,-1.27965 -4.24278,-1.08988 z m 31.09112,0.51575 0.12157,0.47196 0.21896,1.46453 4.33038,-0.6617 -0.23841,-1.57159 -0.0199,-0.11183 -0.0249,-0.10704 -0.15076,-0.57413 z m -31.48521,3.13343 -0.005,0.11183 0.005,0.11183 0.0826,1.62996 0.005,0.10719 0.0199,0.11183 0.0439,0.27734 4.3255,-0.6617 -0.0249,-0.1557 -0.0731,-1.42077 0.009,-0.16541 -4.37417,-0.21898 z m 31.81122,1.53267 -0.068,0.42817 4.33036,0.66173 0.0828,-0.54984 0.0199,-0.11183 0.005,-0.10704 0.0828,-1.62996 -4.37417,-0.22395 z m -31.20303,3.1821 0.17513,0.68118 0.0292,0.10704 0.0389,0.1021 0.506,1.39158 4.11143,-1.50349 -0.46709,-1.28938 -0.15076,-0.58385 z m 30.64348,-0.47196 -0.44762,1.21151 -0.0389,0.0877 0.009,0.005 -0.009,0.0199 0.20428,0.0731 3.74166,1.80514 0.0826,-0.17513 0.0487,-0.0975 0.0341,-0.1021 0.54007,-1.46454 0.0341,-0.1021 0.0292,-0.1072 0.10705,-0.41845 -4.24281,-1.08988 z m -28.71671,5.08453 0.50602,0.83689 0.0536,0.0877 0.0633,0.0826 0.72984,0.97311 3.50323,-2.61768 -0.652,-0.8758 -0.46224,-0.75904 z m 26.99431,-1.51805 -0.8223,1.0996 3.50809,2.62257 0.8904,-1.19694 0.0633,-0.0826 0.0536,-0.0877 0.36492,-0.59845 -3.74163,-2.27712 z m -23.89006,5.42511 0.88068,0.79795 0.0777,0.0731 0.0826,0.0633 0.79796,0.59848 2.62256,-3.50811 -0.7055,-0.53036 -0.81258,-0.73469 z m 21.22857,-2.50577 -0.92447,0.69579 2.61768,3.50807 1.02178,-0.76389 0.0877,-0.0633 0.0729,-0.0731 0.68119,-0.61306 -2.94853,-3.24048 z m -17.18041,5.42515 1.28939,0.62279 0.0975,0.0439 0.0975,0.0389 0.71525,0.25789 1.5083,-4.11144 -0.62279,-0.22395 -1.18234,-0.57413 z m 13.79884,-3.37187 -0.87094,0.32114 1.50345,4.11141 0.97312,-0.35518 0.0975,-0.0389 0.0975,-0.0439 1.04123,-0.50115 -1.90243,-3.94601 z m -8.28613,1.10934 -1.00715,3.91196 0.18012,0.0487 0.10719,0.0249 0.10705,0.0199 1.58618,0.24314 0.10704,0.0154 0.11183,0.005 0.39898,0.0199 0.21898,-4.36932 -0.2968,-0.0199 -1.37212,-0.20925 -0.0582,-0.0154 v 0.005 l -0.0341,-0.005 z m 4.36446,-0.1021 -0.58875,0.0292 0.22372,4.37418 0.67145,-0.0341 0.11183,-0.005 0.1072,-0.0154 1.49863,-0.2287 -0.66175,-4.33036 z"
565
+         id="path4598-7-5"
566
+         inkscape:connector-curvature="0" />
567
+    </g>
549 568
     <path
550 569
        sodipodi:nodetypes="ccccccccccccc"
551 570
        d="m 292.35213,454.9857 10.31454,-5.95477 -7.83102,-13.56371 -10.31453,5.95964 -15.65357,-2.8e-4 -10.31405,-5.95991 -7.831,13.56371 10.31404,5.95504 7.82654,13.55161 v 11.91481 h 15.66202 v -11.91481 z"
+26 -14
Nasal/display.nas
... ...
@@ -23,19 +23,6 @@ var displayClass = {
23 23
         # Softkeys revert to the previous level after 45 seconds of inactivity.
24 24
         m.softkeys_inactivity_delay = 45;
25 25
 
26
-        if (device.role == 'MFD') {
27
-            m.MFDMapTiles = MapTiles.new(m.display);
28
-            m.MFDMapNavaids = PositionedLayer.new(m.display);
29
-            var eis_dir = data.zkv1000_dir ~ 'Nasal/EIS/';
30
-            var eis_type = getprop('/instrumentation/zkv1000/eis/type');
31
-            if (eis_type == nil or
32
-                    (io.stat(eis_dir ~ eis_type ~ '.nas') == nil
33
-                     and print(eis_type ~ ' not found')))
34
-                eis_type = 'none';
35
-            io.load_nasal(eis_dir ~ eis_type ~ '.nas', 'zkv1000');
36
-            io.load_nasal(data.zkv1000_dir ~ 'Nasal/MFD.pages.nas', 'zkv1000');
37
-        }
38
-
39 26
         return m;
40 27
     },
41 28
 #}}}
... ...
@@ -191,6 +178,13 @@ var displayClass = {
191 178
                 me.device.data['aoa-auto'] = 0;
192 179
             }
193 180
             else {
181
+                var eis_dir = data.zkv1000_dir ~ 'Nasal/EIS/';
182
+                var eis_type = getprop('/instrumentation/zkv1000/eis/type');
183
+                if (eis_type == nil or
184
+                        (io.stat(eis_dir ~ eis_type ~ '.nas') == nil
185
+                         and print(eis_type ~ ' not found')))
186
+                    eis_type = 'none';
187
+                io.load_nasal(eis_dir ~ eis_type ~ '.nas', 'zkv1000');
194 188
                 if (contains(me.parents[0], 'showEIS'))
195 189
                     me.showEIS(groups);
196 190
             }
... ...
@@ -214,10 +208,28 @@ var displayClass = {
214 208
             }
215 209
             else {
216 210
                 me.updateEIS();
211
+                me.device.timers.map = maketimer(1, me, func {
212
+                        me.MFDMapTiles.updateTiles();
213
+                        me.MFDMapNavaids.update();
214
+                        var gspd = getprop('/velocities/groundspeed-kt');
215
+                        if (gspd != 0)
216
+                            var next = (me.device.data['range-nm']/(gspd/3600))/(me.display.get('view[1]')/2);
217
+                        else
218
+                            var next = 10;
219
+                        if (next > 10)
220
+                            next = 10;
221
+                        me.device.timers.map.restart(next);
222
+                    });
223
+                me.device.timers.map.singleShot = 1;
224
+                me.device.data.zoom = 10;
225
+                me.MFDMapTiles = MapTiles.new(me.device);
226
+                me.MFDMapTiles.changeZoom(0);
227
+                me.MFDMapNavaids = PositionedLayer.new(me.device);
217 228
                 me.MFDMapNavaids.setVisible(1);
218 229
                 me.MFDMapNavaids.update();
219 230
                 me.MFDMapTiles.initialize_grid();
220
-                me.MFDMapTiles.update_timer.start();
231
+                me.device.timers.map.start();
232
+                io.load_nasal(data.zkv1000_dir ~ 'Nasal/MFD.pages.nas', 'zkv1000');
221 233
                 me['page selected'] = 0;
222 234
                 me.device.data['page selection'] = [
223 235
                     {
+96 -31
Nasal/map.nas
... ...
@@ -2,11 +2,11 @@
2 2
 var MapTiles = {
3 3
 # displays maps background from web tiles {{{
4 4
 # code from http://wiki.flightgear.org/Canvas_Snippets#A_simple_tile_map
5
-    new : func (display) {
5
+    new : func (device) {
6 6
         var m = { parents: [MapTiles] };
7
-        m.display = display;
7
+        m.device = device;
8
+        m.display = m.device.display.display;
8 9
         m.tile_size = 256;
9
-        m.zoom = 10;
10 10
         m.maps_base = getprop("/sim/fg-home") ~ '/cache/maps';
11 11
         m.makeUrl = string.compileTemplate('https://{server}/{type}/{z}/{x}/{y}.png{apikey}');
12 12
         m.makePath = string.compileTemplate(m.maps_base ~ '/{server}/{type}/{z}/{x}/{y}.png');
... ...
@@ -22,18 +22,18 @@ var MapTiles = {
22 22
             .setCenter(
23 23
                     m.display.get('view[0]') / 2,
24 24
                     m.display.get('view[1]') / 2
25
-            );
25
+            )
26
+            .set('clip', 'rect(56,1024,742,148)'); # TODO use z-index (think INSET), or reorder code
26 27
         m.tiles = setsize([], m.num_tiles[0]);
27 28
         m.last_tile = [-1,-1];
28 29
         m.last_type = data['tiles-type'];
29
-        m.update_timer = maketimer(1, m, m.updateTiles);
30 30
         return m;
31 31
     },
32 32
 
33 33
 # Simple user interface (Buttons for zoom and label for displaying it)
34 34
     changeZoom : func (d) {
35
-        me.zoom = math.max(2, math.min(19, me.zoom + d));
36
-        call(me.updateTiles, [], me);
35
+        me.device.data.zoom = math.max(2, math.min(19, me.device.data.zoom + d));
36
+        me.device.data['range-nm'] = me.display.get('view[1]') / 2 * 84.53 * math.cos(data.lat) / math.pow(2, me.device.data.zoom);
37 37
     },
38 38
 
39 39
 # initialize the map by setting up a grid of raster images
... ...
@@ -49,7 +49,7 @@ var MapTiles = {
49 49
     updateTiles : func {
50 50
 #        me.group.setRotation(-data.hdg * D2R);
51 51
 
52
-        var n = math.pow(2, me.zoom);
52
+        var n = math.pow(2, me.device.data.zoom);
53 53
         var offset = [
54 54
             n * ((data.lon + 180) / 360) - me.center_tile_offset[0],
55 55
             (1 - math.ln(math.tan(data.lat * math.pi/180) + 1 / math.cos(data.lat * math.pi/180)) / math.pi) / 2 * n - me.center_tile_offset[1]
... ...
@@ -70,7 +70,7 @@ var MapTiles = {
70 70
             for(var x = 0; x < me.num_tiles[0]; x += 1)
71 71
                 for(var y = 0; y < me.num_tiles[1]; y += 1) {
72 72
                     var pos = {
73
-                        z: me.zoom,
73
+                        z: me.device.data.zoom,
74 74
                         x: int(offset[0] + x),
75 75
                         y: int(offset[1] + y),
76 76
                         type: data['tiles-type'],
... ...
@@ -100,11 +100,6 @@ var MapTiles = {
100 100
             me.last_type = data['tiles-type'];
101 101
         }
102 102
     },
103
-
104
-    del : func {
105
-        me.update_timer.stop();
106
-        call(canvas.Window.del, [], me);
107
-    },
108 103
 };
109 104
 # }}}
110 105
 
... ...
@@ -224,16 +219,19 @@ var MapAirportItem = {
224 219
         return m;
225 220
     },
226 221
     create : func (group) {
227
-        me._can.group = group.createChild('group', 'airport_' ~ me._id);
222
+        me._can.group = group
223
+            .createChild('group', 'airport_' ~ me._id);
224
+
228 225
         me._can.image = me._can.group.createChild('image', 'airport-image_' ~ me._id)
229 226
             .setFile(mapIconCache._canvas.getPath())
230 227
             .setSourceRect(0,0,0,0,0);
228
+
231 229
         me._can.label = me._can.group.createChild('text', 'airport-label_' ~ me._id)
232 230
             .setDrawMode( canvas.Text.TEXT )
233 231
             .setTranslation(0, 37)
234 232
             .setAlignment('center-bottom-baseline')
235 233
             .setFont('LiberationFonts/LiberationSans-Regular.ttf')
236
-            .setFontSize(32);
234
+            .setFontSize(24);
237 235
 
238 236
         me._can.label.set('fill','#BACBFB');
239 237
         me._can.label.set('stroke','#000000');
... ...
@@ -350,7 +348,8 @@ var MapNavaidItem = {
350 348
         return m;
351 349
     },
352 350
     create : func (group) {
353
-        me._can.group = group.createChild('group', me._type ~ '_' ~ me._id);
351
+        me._can.group = group
352
+            .createChild('group', me._type ~ '_' ~ me._id);
354 353
 
355 354
         me._can.image = me._can.group.createChild('image', me._type ~ '-image_' ~ me._id)
356 355
             .setFile(mapIconCache._canvas.getPath())
... ...
@@ -361,7 +360,7 @@ var MapNavaidItem = {
361 360
             .setTranslation(0,42)
362 361
             .setAlignment('center-bottom-baseline')
363 362
             .setFont('LiberationFonts/LiberationSans-Regular.ttf')
364
-            .setFontSize(32);
363
+            .setFontSize(24);
365 364
 
366 365
         me._can.label.set('fill','#BACBFB');
367 366
         me._can.label.set('stroke','#000000');
... ...
@@ -379,9 +378,51 @@ var MapNavaidItem = {
379 378
 };
380 379
 # }}}
381 380
 
381
+var MapAirplaneItem = {
382
+    new : func {
383
+        var m = {parents:[MapAirplaneItem]};
384
+        m._can = {
385
+            'group' : nil,
386
+            'image' : nil,
387
+        };
388
+        return m;
389
+    },
390
+    create : func (group) {
391
+        me._can.group = group
392
+            .createChild('group', 'airplane');
393
+        me._can.image = me._can.group.createChild('image', 'airplane-image')
394
+            .setFile(mapIconCache._canvas.getPath())
395
+            .setSourceRect(0,0,0,0,0);
396
+        return me._can.group;
397
+    },
398
+    setData : func {
399
+        mapIconCache.boundIconToImage('airplane', me._can.image);
400
+        me._can.group
401
+            .setGeoPosition(data.lat, data.lon)
402
+            .setRotation(data.hdg * D2R);
403
+    },
404
+    setVisible : func (visibility) {
405
+        me._can.group.setVisible(visibility);
406
+    },
407
+};
408
+
382 409
 var MAP_RUNWAY_SURFACE =  {0:0, 1:1, 2:1, 3:0, 4:0, 5:0, 6:1, 7:1, 8:0, 9:0, 10:0, 11:0, 12:0};
383
-var MAP_RUNWAY_AT_RANGE = {2:0, 4:0, 10:0, 20:0, 30:0, 40:250, 50:500, 80:1000, 160:2000, 240:3000}; # TODO: make it compatible with tiles zoom level
384
-var MAP_TXRANGE_VOR     = {2:0, 4:0, 10:0, 20:0, 30:0, 40:20,  50:25,  80:30,   160:50,   240:100}; # TODO: make it compatible with tiles zoom level
410
+var MAP_RUNWAY_AT_RANGE = func (range) {
411
+    if (range < 40) return 0;
412
+    if (range < 50) return 250;
413
+    if (range < 80) return 500;
414
+    if (range < 160) return 1000;
415
+    if (range < 240) return 3000;
416
+    return 3000;
417
+}
418
+var MAP_TXRANGE_VOR = func (range) {
419
+    if (range < 40) return 0;
420
+    if (range < 50) return 20;
421
+    if (range < 80) return 25;
422
+    if (range < 160) return 30;
423
+    if (range < 240) return 50;
424
+    return 100;
425
+}
385 426
 ####
386 427
 # Declutter
387 428
 #   land
... ...
@@ -397,11 +438,20 @@ var MAP_TXRANGE_VOR     = {2:0, 4:0, 10:0, 20:0, 30:0, 40:20,  50:25,  80:30,
397 438
 
398 439
 var PositionedLayer = {
399 440
 # the layer to show navaids, airports and airplane symbol {{{
400
-    new : func (display) {
441
+    new : func (device) {
401 442
         var m = {parents : [PositionedLayer]};
402 443
 
403 444
         m._model = nil;
404
-        m._group = display.createGroup().createChild('map', 'MFD map');
445
+        m.device = device;
446
+        var display = m.device.display.display;
447
+        m._group = display.createGroup().createChild('map', 'MFD map')
448
+            .set('clip', 'rect(56,1024,742,148)'); # TODO use z-index (think INSET), or reorder code
449
+        m._group
450
+            .setTranslation(
451
+                display.get('view[0]')/2,
452
+                display.get('view[1]')/2); # TODO compute from EIS size and screen size
453
+        m._group._node.getNode('range', 1)
454
+            .setDoubleValue(13.5); # TODO find a far less esoteric way to get range value
405 455
 
406 456
         m._can = {};
407 457
         m._cache = {};
... ...
@@ -413,6 +463,11 @@ var PositionedLayer = {
413 463
                 'max' : 100,
414 464
             };
415 465
         }
466
+        m._can['airplane'] = m._group.createChild('group', 'airplane');
467
+        m._cache['airplane'] = {
468
+            displayed : 0,
469
+            item : nil,
470
+        };
416 471
 
417 472
         m._mapOptions = {
418 473
             declutterLand : 3,
... ...
@@ -420,27 +475,28 @@ var PositionedLayer = {
420 475
             lightning     : 0,
421 476
             reports       : 0,
422 477
             overlay       : 0,
423
-            range         : 30,
424
-            rangeLow      : 15,
478
+            range         : m.device.data['range-nm'],
479
+            rangeLow      : m.device.data['range-nm'] / 2,
425 480
             runwayLength  : -1,
426 481
             orientation   : 0,
427 482
         };
428 483
 
429 484
         m._results = nil;
430
-        m._timer = maketimer(600, m, PositionedLayer.update);
431 485
 
432 486
         m._visibility = 0;
433 487
 
434 488
         return m;
435 489
     },
436 490
     update : func {
491
+        me._group._node.getNode('ref-lat', 1).setDoubleValue(data.lat);
492
+        me._group._node.getNode('ref-lon', 1).setDoubleValue(data.lon);
493
+
437 494
         if (me._visibility == 1) {
438 495
             me.loadAirport();
439 496
             foreach (var n; ['VOR', 'TACAN', 'NDB', 'DME'])
440 497
                 me.loadNavaid(n);
498
+            me.loadAirplane();
441 499
         }
442
-        #TODO compute from actual speed (220 = Vne extra500)
443
-        me._timer.restart(me._mapOptions.range/(220/3600));
444 500
     },
445 501
     _onVisibilityChange : func {
446 502
         me._group.setVisible(me._visibility);
... ...
@@ -457,8 +513,8 @@ var PositionedLayer = {
457 513
         }
458 514
     },
459 515
     setRange : func (range=100) {
460
-        me._mapOptions.range = range;
461
-        me._mapOptions.rangeLow = range/2;
516
+        me._mapOptions.range = me.device.data['range-nm'];
517
+        me._mapOptions.rangeLow = me._mapOptions.range/2;
462 518
         me.update();
463 519
     },
464 520
     setRotation : func (deg) {
... ...
@@ -481,7 +537,7 @@ var PositionedLayer = {
481 537
         var item = nil;
482 538
 
483 539
         if (me._mapOptions.declutterNAV >= 2)
484
-            me._mapOptions.runwayLength = MAP_RUNWAY_AT_RANGE[me._mapOptions.range];
540
+            me._mapOptions.runwayLength = MAP_RUNWAY_AT_RANGE(me._mapOptions.range);
485 541
         elsif (me._mapOptions.declutterNAV >= 1)
486 542
             me._mapOptions.runwayLength = 2000;
487 543
         else
... ...
@@ -516,7 +572,7 @@ var PositionedLayer = {
516 572
         me._cache[type].index = 0;
517 573
         if (me._mapOptions.declutterNAV >= 3) { # TODO test for DME and NDB range < 100nm
518 574
             var range = me._mapOptions.range * 2.5;
519
-            var txRange = MAP_TXRANGE_VOR[me._mapOptions.range];
575
+            var txRange = MAP_TXRANGE_VOR(me._mapOptions.range);
520 576
             var results = positioned.findWithinRange(range, type);
521 577
             var item = nil;
522 578
             foreach (var n; results) {
... ...
@@ -545,5 +601,14 @@ var PositionedLayer = {
545 601
             item.setVisible(0);
546 602
         }
547 603
     },
604
+    loadAirplane : func {
605
+        if (!me._cache.airplane.displayed) {
606
+            me._cache.airplane.item = MapAirplaneItem.new();
607
+            me._cache.airplane.item.create(me._can['airplane']);
608
+            me._cache.airplane.displayed = 1;
609
+        }
610
+        me._cache.airplane.item.setData();
611
+        me._cache.airplane.item.setVisible(1);
612
+    },
548 613
 };
549 614
 # }}}
+3
README.md
... ...
@@ -84,6 +84,7 @@ Please report bug at <seb.marque@free.fr>.
84 84
   * make booting animation visible ![][pending]
85 85
 * ![][60%]
86 86
   * NOT TESTED: add the posssibility to only use Nasal part of the instrument. This in case of a cockpit which already includes needed objects and animations for screens, knobs and buttons in its config files
87
+  * ND and map display: synchronized tiles and navaids ![][done], range change ![][ongoing], map heads up ![][pending]
87 88
 * ![][50%]
88 89
   * EIS: animations for temperature for YaSim and JSBSim
89 90
 * ![][40%]
... ...
@@ -102,6 +103,8 @@ Please report bug at <seb.marque@free.fr>.
102 103
   * PFD settings
103 104
   * texture for some MFD buttons
104 105
   * rotation and zooming of online maps in-flight ![][pending]
106
+  * replace the use of `clip` by a better system in map display (think also about INSET)
107
+  * reorganise the mess in initialization phase (`showInitProgress` and `_showInitProgress`)
105 108
   * VS guidance
106 109
   * VNAV
107 110
   * scrolling lift in menus