Showing 2 changed files with 230 additions and 1 deletions
+69
Nasal/display.nas
... ...
@@ -105,6 +105,7 @@ var displayClass = {
105 105
                     'MapOrientation',
106 106
                     'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind', 'WindData-NODATA',
107 107
                     'AOA', 'AOA-needle', 'AOA-text', 'AOA-approach',
108
+                    'MFD-navbox',
108 109
 # }}}
109 110
                 );
110 111
                 append(groups.clip,
... ...
@@ -134,6 +135,7 @@ var displayClass = {
134 135
                     'WindData-OPTN1-HDG-text', 'WindData-OPTN1-SPD-text',
135 136
                     'WindData-OPTN2-crosswind-text', 'WindData-OPTN2-headwind-text',
136 137
                     'XPDR-MODE-text', 'XPDR-DIGIT-3-text', 'XPDR-DIGIT-2-text', 'XPDR-DIGIT-1-text', 'XPDR-DIGIT-0-text',
138
+                    'ETE', 'ETE-text', 'DIS', 'DIS-text', 'LEG-text',
137 139
                     'AltBigC', 'AltSmallC'
138 140
 # }}}
139 141
                 );
... ...
@@ -176,6 +178,11 @@ var displayClass = {
176 178
 
177 179
                 if (contains(m.parents[0], 'showEIS'))
178 180
                     m.showEIS(groups);
181
+
182
+                append(groups.hide, 'PFD-navbox');
183
+                for (var i=1; i <= 4; i+=1)
184
+                    foreach (var t; ['ID', 'VAL'])
185
+                        append(groups.text, 'DATA-FIELD' ~ i ~ '-' ~ t ~ '-text');
179 186
             }
180 187
 
181 188
             canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Systems/softkeys.svg');
... ...
@@ -324,6 +331,7 @@ var displayClass = {
324 331
         me.updateCOMM({auto:'comm', tune: radios.getNode('comm-tune').getValue()});
325 332
         me.softkeys_inactivity();
326 333
         me.updateSoftKeys();
334
+        me.updateNavigationBox();
327 335
     },
328 336
 #}}}
329 337
 
... ...
@@ -482,6 +490,67 @@ var displayClass = {
482 490
     },
483 491
 #}}}
484 492
 
493
+    updateNavigationBox : func {
494
+# update Navigation Box on MFD and PFD header {{{
495
+        var route = me.device.map.layers.route;
496
+        var fpSize = size(route.flightPlan);
497
+        var navbox = {
498
+            DTK: func {
499
+                var dtk = getprop('/instrumentation/gps/wp/wp[1]/desired-course-deg');
500
+                if (dtk == nil)
501
+                    return '---°';
502
+                else
503
+                    return sprintf('%03i°', dtk);
504
+            },
505
+            ETE: func {
506
+                if (fpSize == 0) return '--:--';
507
+                var eteSeconds = getprop('/autopilot/route-manager/ete');
508
+                var eteHours = math.floor(eteSeconds / 3600);
509
+                var eteMinutes = int((eteSeconds - (eteHours * 3600)) / 60);
510
+                return sprintf(eteHours > 99 ? '--:--' : '%02i:%02i', eteHours, eteMinutes);
511
+            },
512
+            DIS: func {
513
+                if (fpSize == 0) return '---NM';
514
+                var dist = getprop('/autopilot/route-manager/distance-remaining-nm');
515
+                return sprintf(dist >= 100 ? '%i' : '%.1f', dist);
516
+            },
517
+            LEG: func {
518
+                if (fpSize == 0) return '';
519
+                var wp = route.flightPlan[route.currentLeg.index];
520
+                return wp[0].name ~ ' > ' ~ wp[1].name;
521
+            },
522
+            GS : func return sprintf('%iKT', getprop('/velocities/groundspeed-kt')),
523
+            TRK: func return sprintf('%03i°', getprop('/orientation/track-deg')),
524
+            TAS: func return sprintf('%i', getprop('/instrumentation/airspeed-indicator/true-speed-kt')),
525
+            BRG: func return '---°',
526
+            END: func return '---NM',
527
+            ESA: func return '-----',
528
+            ETA: func return '--:--',
529
+            FOB: func return '---lbs',
530
+            ISA: func return '-----',
531
+            LDG: func return '--:--',
532
+            MSA: func return '----ft',
533
+            TKE: func return '---°',
534
+            VSR: func return '----',
535
+            XTK: func return '---NM',
536
+        };
537
+        if (me.device.role == 'MFD') {
538
+            for (var i=1; i<=4; i+=1)
539
+                me.screenElements['DATA-FIELD' ~ i ~ '-VAL-text']
540
+                    .setText(
541
+                        navbox[me.screenElements['DATA-FIELD' ~ i ~ '-ID-text'].get('text')]()
542
+                    );
543
+            settimer(func me.updateNavigationBox(), 0.6);
544
+        }
545
+        else { # PFD
546
+            me.screenElements['ETE-text'].setText(navbox.ETE());
547
+            me.screenElements['DIS-text'].setText(navbox.DIS());
548
+            me.screenElements['LEG-text'].setText(navbox.LEG());
549
+            settimer(func me.updateNavigationBox(), 0.3);
550
+        }
551
+    },
552
+#}}}
553
+
485 554
     updateSoftKeys : func {
486 555
 # update SoftKeys boxes {{{
487 556
         # on PFD the last boxes are always BACK and ALERTS
+161 -1
Systems/header-nav-comm.svg
... ...
@@ -51,7 +51,8 @@
51 51
   <g
52 52
      id="layer1"
53 53
      inkscape:groupmode="layer"
54
-     inkscape:label="Calque 1">
54
+     inkscape:label="Calque 1"
55
+     style="display:inline">
55 56
     <g
56 57
        id="Header"
57 58
        inkscape:label="Header"
... ...
@@ -408,5 +409,164 @@
408 409
            inkscape:connector-curvature="0" />
409 410
       </g>
410 411
     </g>
412
+    <g
413
+       id="PFD-navbox"
414
+       inkscape:label="PFD-navbox"
415
+       style="display:inline">
416
+      <text
417
+         inkscape:label="LEG-text"
418
+         id="LEG-text"
419
+         y="22.123667"
420
+         x="263.75085"
421
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
422
+         xml:space="preserve"><tspan
423
+           style="fill:#ff00ff"
424
+           y="40.998669"
425
+           x="263.75085"
426
+           id="tspan4549"
427
+           sodipodi:role="line" /></text>
428
+      <text
429
+         inkscape:label="DIS"
430
+         id="DIS"
431
+         y="21.821583"
432
+         x="500.63165"
433
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
434
+         xml:space="preserve"><tspan
435
+           y="21.821583"
436
+           x="500.63165"
437
+           id="tspan4553"
438
+           sodipodi:role="line">DIS</tspan></text>
439
+      <text
440
+         inkscape:label="DIS-text"
441
+         id="DIS-text"
442
+         y="21.746063"
443
+         x="540.22955"
444
+         style="font-style:normal;font-weight:normal;font-size:26.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
445
+         xml:space="preserve"><tspan
446
+           y="21.746063"
447
+           x="540.22955"
448
+           id="tspan4557"
449
+           sodipodi:role="line">--.-</tspan></text>
450
+      <text
451
+         inkscape:label="ETE"
452
+         id="ETE"
453
+         y="22.123667"
454
+         x="639.22455"
455
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
456
+         xml:space="preserve"><tspan
457
+           y="22.123667"
458
+           x="639.22455"
459
+           id="tspan4561"
460
+           sodipodi:role="line">ETE</tspan></text>
461
+      <text
462
+         inkscape:label="ETE-text"
463
+         id="ETE-text"
464
+         y="21.746063"
465
+         x="681.65094"
466
+         style="font-style:normal;font-weight:normal;font-size:26.66666603px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
467
+         xml:space="preserve"><tspan
468
+           style="fill:#ff00ff"
469
+           y="21.746063"
470
+           x="681.65094"
471
+           id="tspan4569"
472
+           sodipodi:role="line">--:--</tspan></text>
473
+    </g>
474
+    <g
475
+       id="MFD-navbox"
476
+       inkscape:label="MFD-navbox"
477
+       style="display:inline">
478
+      <text
479
+         inkscape:label="DATA-FIELD1-ID-text"
480
+         id="DATA-FIELD1-ID-text"
481
+         y="22.002344"
482
+         x="265.87216"
483
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
484
+         xml:space="preserve"><tspan
485
+           style="fill:#ffffff"
486
+           y="22.002344"
487
+           x="265.87216"
488
+           id="tspan4587"
489
+           sodipodi:role="line">GS</tspan></text>
490
+      <text
491
+         inkscape:label="DATA-FIELD2-ID-text"
492
+         id="DATA-FIELD2-ID-text"
493
+         y="22.002344"
494
+         x="389.5159"
495
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
496
+         xml:space="preserve"><tspan
497
+           style="fill:#ffffff"
498
+           y="22.002344"
499
+           x="389.5159"
500
+           id="tspan4587-6"
501
+           sodipodi:role="line">DTK</tspan></text>
502
+      <text
503
+         inkscape:label="DATA-FIELD3-ID-text"
504
+         id="DATA-FIELD3-ID-text"
505
+         y="22.002344"
506
+         x="513.15961"
507
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
508
+         xml:space="preserve"><tspan
509
+           style="fill:#ffffff"
510
+           y="22.002344"
511
+           x="513.15961"
512
+           id="tspan4587-5"
513
+           sodipodi:role="line">TRK</tspan></text>
514
+      <text
515
+         inkscape:label="DATA-FIELD4-ID-text"
516
+         id="DATA-FIELD4-ID-text"
517
+         y="22.002344"
518
+         x="636.80328"
519
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
520
+         xml:space="preserve"><tspan
521
+           style="fill:#ffffff"
522
+           y="22.002344"
523
+           x="636.80328"
524
+           id="tspan4587-62"
525
+           sodipodi:role="line">ETE</tspan></text>
526
+      <text
527
+         inkscape:label="DATA-FIELD1-VAL-text"
528
+         id="DATA-FIELD1-VAL-text"
529
+         y="22.002344"
530
+         x="313.06903"
531
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
532
+         xml:space="preserve"><tspan
533
+           y="22.002344"
534
+           x="313.06903"
535
+           id="tspan4625"
536
+           sodipodi:role="line">0</tspan></text>
537
+      <text
538
+         inkscape:label="DATA-FIELD2-VAL-text"
539
+         id="DATA-FIELD2-VAL-text"
540
+         y="22.002344"
541
+         x="436.71277"
542
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
543
+         xml:space="preserve"><tspan
544
+           y="22.002344"
545
+           x="436.71277"
546
+           id="tspan4625-1"
547
+           sodipodi:role="line">000°</tspan></text>
548
+      <text
549
+         inkscape:label="DATA-FIELD3-VAL-text"
550
+         id="DATA-FIELD3-VAL-text"
551
+         y="22.002344"
552
+         x="560.35645"
553
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
554
+         xml:space="preserve"><tspan
555
+           y="22.002344"
556
+           x="560.35645"
557
+           id="tspan4625-7"
558
+           sodipodi:role="line">000°</tspan></text>
559
+      <text
560
+         inkscape:label="DATA-FIELD4-VAL-text"
561
+         id="DATA-FIELD4-VAL-text"
562
+         y="22.002344"
563
+         x="684.00012"
564
+         style="font-style:normal;font-weight:normal;font-size:21.33333397px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
565
+         xml:space="preserve"><tspan
566
+           y="22.002344"
567
+           x="684.00012"
568
+           id="tspan4625-2"
569
+           sodipodi:role="line">--:--</tspan></text>
570
+    </g>
411 571
   </g>
412 572
 </svg>