Showing 2 changed files with 23 additions and 0 deletions
+8
Nasal/core.nas
... ...
@@ -66,6 +66,14 @@ var setListeners = func {
66 66
                     device[1].display.updateHDG(val);
67 67
                 }
68 68
             }, 0, 2);
69
+    setlistener('/instrumentation/zkv1000/cdi/course',
70
+            func (n) {
71
+                var val = n.getValue();
72
+                if (val != nil) {
73
+                    device[0].display.updateCRS(val);
74
+                    device[1].display.updateCRS(val);
75
+                }
76
+            }, 0, 2);
69 77
 }
70 78
 
71 79
 var deviceClass = {
+15
Nasal/display.nas
... ...
@@ -515,6 +515,21 @@ var displayClass = {
515 515
     },
516 516
 #}}}
517 517
 
518
+    updateCRS : func (crs) {
519
+# TODO: update display for NAV/GPS/BRG courses {{{
520
+        if (me.role == 'MFD')
521
+            return;
522
+        me.screenElements['SelectedCRS-bg']
523
+            .show();
524
+        me.screenElements['SelectedCRS-bgtext']
525
+            .show();
526
+        me.screenElements['SelectedCRS-text']
527
+            .setText(sprintf('%03d°%s', crs, ''))
528
+            .show();
529
+        me.addTimer(3, ['SelectedCRS-text', 'SelectedCRS-bgtext', 'SelectedCRS-bg']);
530
+    },
531
+#}}}
532
+
518 533
     _updateRadio: func {
519 534
 #{{{
520 535
         # arg[0]._r = <comm|nav>