Showing 5 changed files with 126 additions and 14 deletions
+17
Nasal/maps/navaids.nas
... ...
@@ -384,6 +384,23 @@ var MapNavaids = {
384 384
 
385 385
         m._results = nil;
386 386
 
387
+        if (m.device.role == 'PFD') {
388
+            m.device.softkeys.colored.INSETNAVAIDSALL = 1;
389
+            m.device.softkeys.colored.INSETNAVAIDSTACAN = 1;
390
+            m.device.softkeys.colored.INSETNAVAIDSVOR = 1;
391
+            m.device.softkeys.colored.INSETNAVAIDSNDB = 1;
392
+            m.device.softkeys.colored.INSETNAVAIDSDME = 1;
393
+            m.device.softkeys.colored.INSETNAVAIDSAPT = 1;
394
+        }
395
+        if (m.device.role == 'MFD') {
396
+            m.device.softkeys.colored.MAPNAVAIDSALL = 1;
397
+            m.device.softkeys.colored.MAPNAVAIDSTACAN = 1;
398
+            m.device.softkeys.colored.MAPNAVAIDSVOR = 1;
399
+            m.device.softkeys.colored.MAPNAVAIDSNDB = 1;
400
+            m.device.softkeys.colored.MAPNAVAIDSDME = 1;
401
+            m.device.softkeys.colored.MAPNAVAIDSAPT = 1;
402
+        }
403
+
387 404
         return m;
388 405
     },
389 406
     update : func {
+5
Nasal/maps/route.nas
... ...
@@ -212,6 +212,11 @@ var MapRoute = {
212 212
         m.flightPlan = [];
213 213
         m.currentWpIndex = getprop('/autopilot/route-manager/current-wp');
214 214
         
215
+        if (m.device.role == 'PFD')
216
+            m.device.softkeys.colored.INSETROUTE = 1;
217
+        if (m.device.role == 'MFD')
218
+            m.device.softkeys.colored.MAPROUTE = 1;
219
+
215 220
         return m;
216 221
     },
217 222
     update: func {
+4
Nasal/maps/tcas.nas
... ...
@@ -89,6 +89,10 @@ var MapTcas = {
89 89
 # /instrumentation/tcas/inputs/mode
90 90
             m.MODE      = ["Normal","Above","Unlimited","Below"];
91 91
         }
92
+        if (m.device.role == 'PFD')
93
+            m.device.softkeys.colored.INSETTRAFFIC = 1;
94
+        if (m.device.role == 'MFD')
95
+            m.device.softkeys.colored.MAPTRAFFIC = 1;
92 96
         return m;
93 97
     },
94 98
 
+4
Nasal/maps/tiles.nas
... ...
@@ -27,6 +27,10 @@ var MapTiles = {
27 27
         m.last_tile = [-1,-1];
28 28
         m.last_type = data['tiles-type'];
29 29
         m.initialize_grid();
30
+        if (m.device.role == 'PFD')
31
+            m.device.softkeys.colored.INSETTERRAIN = 1;
32
+        if (m.device.role == 'MFD')
33
+            m.device.softkeys.colored.MAPTERRAIN = 1;
30 34
         return m;
31 35
     },
32 36
 
+96 -14
Nasal/softkeys.nas
... ...
@@ -62,13 +62,67 @@ var softkeysClass = {
62 62
                     me.device.display.screenElements['PFD-Map-bg'].hide();
63 63
                 },
64 64
                 TRAFFIC: func {
65
-                    me.device.data.tcas = ! me.device.data.tcas;
66
-                    if (me.device.data.tcas)
67
-                        me.colored['INSETTRAFFIC'] = me.device.data.tcas;
65
+                    call(me.bindings.PFD.INSET.declutter, ['INSETTRAFFIC', 'tcas', 2], me);
66
+                },
67
+                ROUTE: func {
68
+                    call(me.bindings.PFD.INSET.declutter, ['INSETROUTE', 'route', 3], me);
69
+                },
70
+                TERRAIN: func {
71
+                    call(me.bindings.PFD.INSET.declutter, ['INSETTERRAIN', 'tiles', 5], me);
72
+                },
73
+                NAVAIDS: {
74
+                    ALL: func (root_id = 'INSETNAVAIDS') {
75
+                        if (contains(me.colored, root_id ~ 'ALL'))
76
+                            foreach (var n; [ 'ALL', 'VOR', 'DME', 'NDB', 'TACAN', 'APT' ])
77
+                                delete(me.colored, root_id ~ n);
78
+                        else
79
+                            foreach (var n; [ 'ALL', 'VOR', 'DME', 'NDB', 'TACAN', 'APT' ])
80
+                                me.colored[root_id ~ n] = 1;
81
+                        me.device.display.updateSoftKeys();
82
+                        foreach (var n; [ 'VOR', 'TACAN', 'NDB', 'DME' ])
83
+                            me.device.map.layers.navaids._can[n]
84
+                                .setVisible(contains(me.colored, root_id ~ n));
85
+                        me.device.map.layers.navaids._can.airport
86
+                            .setVisible(contains(me.colored, root_id ~ 'APT'));
87
+                    },
88
+                    VOR: func {
89
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSVOR', 'VOR', 2], me);
90
+                    },
91
+                    TACAN: func {
92
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSTACAN', 'TACAN', 3], me);
93
+                    },
94
+                    NDB: func {
95
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSNDB', 'NDB', 4], me);
96
+                    },
97
+                    DME: func {
98
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSDME', 'DME', 5], me);
99
+                    },
100
+                    APT: func {
101
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['INSETNAVAIDSAPT', 'airport', 6], me);
102
+                    },
103
+                    declutter: func (id, type) {
104
+                        if (contains(me.colored, id)) {
105
+                            delete(me.colored, id);
106
+                            if (me.device.role == 'PFD')
107
+                                delete(me.colored, 'INSETNAVAIDSALL');
108
+                            if (me.device.role == 'MFD')
109
+                                delete(me.colored, 'MAPNAVAIDSALL');
110
+                        }
111
+                        else
112
+                            me.colored[id] = 1;
113
+                        me.device.display.updateSoftKeys();
114
+                        me.device.map.layers.navaids._can[type]
115
+                            .setVisible(contains(me.colored, id));
116
+                    },
117
+                },
118
+                declutter: func (id, layer) {
119
+                    if (contains(me.colored, id))
120
+                        delete(me.colored, id);
68 121
                     else
69
-                        delete(me.colored, 'INSETTRAFFIC');
122
+                        me.colored[id] = 1;
70 123
                     me.device.display.updateSoftKeys();
71
-                    me.device.map.layers.tcas.setVisible(me.device.data.tcas);
124
+                    me.device.map.layers[layer]
125
+                        .setVisible(contains(me.colored, id));
72 126
                 },
73 127
                 hook : func {
74 128
                     me.device.display.screenElements['PFD-Map-bg'].show();
... ...
@@ -503,13 +557,33 @@ var softkeysClass = {
503 557
             },
504 558
             MAP: {
505 559
                 TRAFFIC: func {
506
-                    me.device.data.tcas = ! me.device.data.tcas;
507
-                    if (me.device.data.tcas)
508
-                        me.colored['MAPTRAFFIC'] = me.device.data.tcas;
509
-                    else
510
-                        delete(me.colored, 'MAPTRAFFIC');
511
-                    me.device.display.updateSoftKeys();
512
-                    me.device.map.layers.tcas.setVisible(me.device.data.tcas);
560
+                    call(me.bindings.PFD.INSET.declutter, ['MAPTRAFFIC', 'tcas', 0], me);
561
+                },
562
+                ROUTE: func {
563
+                    call(me.bindings.PFD.INSET.declutter, ['MAPROUTE', 'route', 1], me);
564
+                },
565
+                TERRAIN: func {
566
+                    call(me.bindings.PFD.INSET.declutter, ['MAPTERRAIN', 'tiles', 3], me);
567
+                },
568
+                NAVAIDS: {
569
+                    ALL: func {
570
+                        call(me.bindings.PFD.INSET.NAVAIDS.ALL, [ 'MAPNAVAIDS' ], me);
571
+                    },
572
+                    VOR: func {
573
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSVOR', 'VOR', 2], me);
574
+                    },
575
+                    TACAN: func {
576
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSTACAN', 'TACAN', 3], me);
577
+                    },
578
+                    NDB: func {
579
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSNDB', 'NDB', 4], me);
580
+                    },
581
+                    DME: func {
582
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSDME', 'DME', 5], me);
583
+                    },
584
+                    APT: func {
585
+                        call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['MAPNAVAIDSAPT', 'airport', 6], me);
586
+                    },
513 587
                 },
514 588
             },
515 589
         },
... ...
@@ -523,7 +597,11 @@ var keyMap = {
523 597
         first : 1,
524 598
         texts : ['INSET', 'SENSOR', 'PFD', 'OBS', 'CDI', 'DME', 'XPDR', 'IDENT', 'TMR/REF', 'NRST' ],
525 599
         INSET : {
526
-            texts : ['OFF', 'DCLTR', 'WXLGND', 'TRAFFIC', 'TOPO', 'TERRAIN', 'STRMSCP', 'NEXRAD-C', 'XM LTNG', 'METAR'],
600
+            texts : ['OFF', '', 'TRAFFIC', 'ROUTE', 'TOPO', 'TERRAIN', 'NAVAIDS', 'METAR'],
601
+            NAVAIDS : {
602
+                first : 2,
603
+                texts : ['VOR', 'TACAN', 'NDB', 'DME', 'APT', '', 'ALL'],
604
+            },
527 605
         },
528 606
         SENSOR : {
529 607
             first : 2,
... ...
@@ -568,7 +646,11 @@ var keyMap = {
568 646
     MFD : {
569 647
         texts : ['ENGINE', '', 'MAP', '', '', '', '', '', '', 'DCLTR', 'SHW CHRT', 'CHKLIST'],
570 648
         MAP : {
571
-            texts: ['TRAFFIC', 'PROFILE', 'TOPO', 'TERRAIN', 'AIRWAYS', 'STRMSCP','NEXRAD-C', 'XM LTNG', 'METAR', 'LEGEND', 'BACK'],
649
+            texts : ['TRAFFIC', 'ROUTE', 'TOPO', 'TERRAIN', 'NAVAIDS', '','', '', '', '', 'BACK'],
650
+            NAVAIDS : {
651
+                first : 2,
652
+                texts : ['VOR', 'TACAN', 'NDB', 'DME', 'APT', '', 'ALL', '', '', 'BACK' ],
653
+            },
572 654
         },
573 655
         CHKLIST : {
574 656
             texts : ['ENGINE', '', '', '', '', 'DONE', '', '', '', '', 'EXIT', 'EMERGCY'],