Showing 2 changed files with 50 additions and 5 deletions
+47 -4
Nasal/MFD.pages.nas
... ...
@@ -1,8 +1,51 @@
1 1
 displayClass.MFD = {
2
-    NRST: {
3
-        'NEAREST VOR' : func {
4
-            # just a POC
5
-            print('here there will be a page for searching nearest VORs');
2
+    AUX: {
3
+        'SYSTEM SETUP' : func {
4
+            var obj_infos = [
5
+                {text: 'NAV BOX DATA FIELDS', type: 'title'},
6
+                {type: 'separator'},
7
+                {text: 'DATA FIELD NUMBER', type: 'normal'},
8
+                {text: '  1 >', type: 'selected|end-of-line', choices: ['  1 >', '< 2 >', '< 3 >', '< 4  ']},
9
+            ];
10
+            var lines = 2;
11
+            var column = 0;
12
+            var colmax = 5;
13
+            foreach (var text; me.device.display.updateNavigationBox(1)) {
14
+                append(obj_infos, {
15
+                    text: text,
16
+                    type: column == colmax ? 'editable|end-of-line' : 'editable',
17
+                    callback: func (id, selected) {
18
+                        var field = me.device.windows.state[id].objects[3].text;
19
+                        field = substr(field, 2);
20
+                        field = substr(field, 0, size(field) - 2);
21
+                        field = string.trim(field);
22
+                        me.device.display.screenElements['DATA-FIELD' ~ field ~ '-ID-text']
23
+                            .setText(me.device.windows.state[id].objects[selected].text);
24
+                    }
25
+                });
26
+                if (column < colmax) column += 1;
27
+                else {
28
+                    column = 0;
29
+                    lines += 1;
30
+                }
31
+            }
32
+            var windowId = 'SYSTEM SETUP';
33
+            var obj_s = size(obj_infos);
34
+            me.device.windows.draw(
35
+                windowId,
36
+                {x: 720, y: 758 - ((lines + 3) * 24), w: 300, l: lines, sep: 1},
37
+                obj_infos
38
+            );
39
+            me.device.buttons.CLR = func {
40
+                me.device.windows.del(windowId);
41
+                me.device.buttons.ENT = func;
42
+                me.device.buttons.CLR = func;
43
+                me.device.knobs.FmsInner = func;
44
+                me.device.knobs.FmsOuter = me.device.knobs.MFD_select_page_group;
45
+            }
46
+            me.device.knobs.FmsInner = me.device.knobs.MenuSettings;
47
+            me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
48
+            me.device.buttons.ENT = me.device.buttons.ValidateTMRREF;
6 49
         },
7 50
     },
8 51
 };
+3 -1
Nasal/display.nas
... ...
@@ -490,7 +490,7 @@ var displayClass = {
490 490
     },
491 491
 #}}}
492 492
 
493
-    updateNavigationBox : func {
493
+    updateNavigationBox : func (getDataFields = 0) {
494 494
 # update Navigation Box on MFD and PFD header {{{
495 495
         var route = me.device.map.layers.route;
496 496
         var fpSize = size(route.flightPlan);
... ...
@@ -534,6 +534,8 @@ var displayClass = {
534 534
             VSR: func return '----',
535 535
             XTK: func return '---NM',
536 536
         };
537
+        if (getDataFields)
538
+            return keys(navbox);
537 539
         if (me.device.role == 'MFD') {
538 540
             for (var i=1; i<=4; i+=1)
539 541
                 me.screenElements['DATA-FIELD' ~ i ~ '-VAL-text']