Showing 1 changed files with 166 additions and 166 deletions
+166 -166
Nasal/display.nas
... ...
@@ -27,192 +27,192 @@ var displayClass = {
27 27
         # Softkeys revert to the previous level after 45 seconds of inactivity.
28 28
         m.softkeys_inactivity_delay = 45;
29 29
 
30
-            var groups = {
31
-                show : [
32
-                    'Header',
33
-                    'SoftKeysTexts', 
34
-                    'COMM', 
35
-                    'NAV', 
36
-                    'nav-freq-switch',
37
-                    'comm-freq-switch',
38
-                ],
39
-                text: [
40
-                    'nav1-standby-freq', 'nav1-selected-freq', 'nav1-id',
41
-                    'nav2-standby-freq', 'nav2-selected-freq', 'nav2-id',
42
-                    'comm1-standby-freq', 'comm1-selected-freq',
43
-                    'comm2-standby-freq', 'comm2-selected-freq',
44
-                ],
45
-                hide : [ 'Failures', 'NAV-COMM-Failures' ],
46
-                clip: [ ],
47
-            };
30
+        var groups = {
31
+            show : [
32
+                'Header',
33
+                'SoftKeysTexts',
34
+                'COMM',
35
+                'NAV',
36
+                'nav-freq-switch',
37
+                'comm-freq-switch',
38
+            ],
39
+            text: [
40
+                'nav1-standby-freq', 'nav1-selected-freq', 'nav1-id',
41
+                'nav2-standby-freq', 'nav2-selected-freq', 'nav2-id',
42
+                'comm1-standby-freq', 'comm1-selected-freq',
43
+                'comm2-standby-freq', 'comm2-selected-freq',
44
+            ],
45
+            hide : [ 'Failures', 'NAV-COMM-Failures' ],
46
+            clip: [ ],
47
+        };
48 48
 
49
-            for (var k = 0; k < 12; k += 1) {
50
-                append(groups.text, sprintf("SoftKey%02i-text", k));
51
-                append(groups.show, sprintf("SoftKey%02i-bg", k));
52
-            }
49
+        for (var k = 0; k < 12; k += 1) {
50
+            append(groups.text, sprintf("SoftKey%02i-text", k));
51
+            append(groups.show, sprintf("SoftKey%02i-bg", k));
52
+        }
53 53
 
54
-            if (m.device.role == 'PFD') {
55
-                append(groups.show,
54
+        if (m.device.role == 'PFD') {
55
+            append(groups.show,
56 56
 # {{{
57
-                    'XPDR-TIME', 
58
-                    'FlightInstruments',
59
-                    'Horizon',
60
-                    'bankPointer',
61
-                    'VSI',
62
-                    'Rose',
63
-                    'Heading-bug',
64
-                    'PFD-Widgets',
65
-                    'Trends',
66
-                    'Airspeed-Trend-Indicator',
67
-                    'Altitude-Trend-Indicator',
68
-                    'OAT',
69
-                    'IAS-bg',
70
-                    'TAS',
71
-                    'GSPD',
72
-                    'BARO-bg',
73
-                    'SlipSkid',
74
-                    'IAS-Vx', 'IAS-Vy', 'IAS-Vr', 'IAS-Vglide',
57
+                'XPDR-TIME',
58
+                'FlightInstruments',
59
+                'Horizon',
60
+                'bankPointer',
61
+                'VSI',
62
+                'Rose',
63
+                'Heading-bug',
64
+                'PFD-Widgets',
65
+                'Trends',
66
+                'Airspeed-Trend-Indicator',
67
+                'Altitude-Trend-Indicator',
68
+                'OAT',
69
+                'IAS-bg',
70
+                'TAS',
71
+                'GSPD',
72
+                'BARO-bg',
73
+                'SlipSkid',
74
+                'IAS-Vx', 'IAS-Vy', 'IAS-Vr', 'IAS-Vglide',
75 75
 # }}}
76
-                );
77
-                append(groups.hide,
76
+            );
77
+            append(groups.hide,
78 78
 # {{{
79
-                    'EIS',
80
-                    'CDI',
81
-                    'OMI', 'MarkerBG', 'MarkerText',
82
-                    'VDI',
83
-                    'NAV1-pointer', 'NAV1-CDI', 'NAV1-FROM', 'NAV1-TO',
84
-                    'NAV2-pointer', 'NAV2-CDI', 'NAV2-FROM', 'NAV2-TO',
85
-                    'GPS-pointer', 'GPS-CDI', 'GPS-CTI', 'GPS-CTI-diamond', 'GPS-FROM', 'GPS-TO',
86
-                    'BRG1-pointer',
87
-                    'BRG2-pointer',
88
-                    'SelectedHDG-bg',
89
-                    'SelectedHDG-bgtext',
90
-                    'SelectedHDG-text',
91
-                    'SelectedCRS-bg',
92
-                    'SelectedCRS-bgtext',
93
-                    'SelectedCRS-text',
94
-                    'SelectedALT', 'SelectedALT-bug', 'SelectedALT-bg', 'SelectedALT-symbol',
95
-                    'TAS',
96
-                    'GSPD',
97
-                    'WindData',
98
-                    'Reversionnary',
99
-                    'Annunciation',
100
-                    'Comparator',
101
-                    'BRG1',
102
-                    'BRG2',
103
-                    'DME1',
104
-                    'PFD-Map-bg',
105
-                    'PFD-Multilines',
106
-                    'MapOrientation',
107
-                    'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind', 'WindData-NODATA',
108
-                    'AOA', 'AOA-needle', 'AOA-text', 'AOA-approach',
109
-                    'MFD-navbox',
110
-                    'Traffic',
79
+                'EIS',
80
+                'CDI',
81
+                'OMI', 'MarkerBG', 'MarkerText',
82
+                'VDI',
83
+                'NAV1-pointer', 'NAV1-CDI', 'NAV1-FROM', 'NAV1-TO',
84
+                'NAV2-pointer', 'NAV2-CDI', 'NAV2-FROM', 'NAV2-TO',
85
+                'GPS-pointer', 'GPS-CDI', 'GPS-CTI', 'GPS-CTI-diamond', 'GPS-FROM', 'GPS-TO',
86
+                'BRG1-pointer',
87
+                'BRG2-pointer',
88
+                'SelectedHDG-bg',
89
+                'SelectedHDG-bgtext',
90
+                'SelectedHDG-text',
91
+                'SelectedCRS-bg',
92
+                'SelectedCRS-bgtext',
93
+                'SelectedCRS-text',
94
+                'SelectedALT', 'SelectedALT-bug', 'SelectedALT-bg', 'SelectedALT-symbol',
95
+                'TAS',
96
+                'GSPD',
97
+                'WindData',
98
+                'Reversionnary',
99
+                'Annunciation',
100
+                'Comparator',
101
+                'BRG1',
102
+                'BRG2',
103
+                'DME1',
104
+                'PFD-Map-bg',
105
+                'PFD-Multilines',
106
+                'MapOrientation',
107
+                'WindData', 'WindData-OPTN1', 'WindData-OPTN2', 'WindData-OPTN1-HDG', 'WindData-OPTN2-symbol', 'WindData-OPTN2-headwind', 'WindData-OPTN2-crosswind', 'WindData-NODATA',
108
+                'AOA', 'AOA-needle', 'AOA-text', 'AOA-approach',
109
+                'MFD-navbox',
110
+                'Traffic',
111 111
 # }}}
112
-                );
113
-                append(groups.clip,
112
+            );
113
+            append(groups.clip,
114 114
 # {{{
115
-                    'SpeedLint1',
116
-                    'SpeedTape',
117
-                    'LintAlt',
118
-                    'AltLint00011',
119
-                    'PitchScale',
115
+                'SpeedLint1',
116
+                'SpeedTape',
117
+                'LintAlt',
118
+                'AltLint00011',
119
+                'PitchScale',
120 120
 # }}}
121
-                );
122
-                append(groups.text,
121
+            );
122
+            append(groups.text,
123 123
 # {{{
124
-                    'SelectedALT-text',
125
-                    'TAS-text',
126
-                    'GSPD-text',
127
-                    'TIME-text',
128
-                    'OAT-text',
129
-                    'VSIText',
130
-                    'Speed110',
131
-                    'Alt11100',
132
-                    'HDG-text',
133
-                    'BARO-text',
134
-                    'CDI-SRC-text', 'CDI-GPS-ANN-text', 'CDI-GPS-XTK-text',
135
-                    'BRG1-pointer', 'BRG1-SRC-text', 'BRG1-DST-text', 'BRG1-WPID-text',
136
-                    'BRG2-pointer', 'BRG2-SRC-text', 'BRG2-DST-text', 'BRG2-WPID-text',
137
-                    'WindData-OPTN1-HDG-text', 'WindData-OPTN1-SPD-text',
138
-                    'WindData-OPTN2-crosswind-text', 'WindData-OPTN2-headwind-text',
139
-                    'XPDR-MODE-text', 'XPDR-DIGIT-3-text', 'XPDR-DIGIT-2-text', 'XPDR-DIGIT-1-text', 'XPDR-DIGIT-0-text',
140
-                    'ETE', 'ETE-text', 'DIS', 'DIS-text', 'LEG-text',
141
-                    'LATMOD-Armed-text', 'LATMOD-Active-text',
142
-                    'AP-Status-text', 'YD-Status-text',
143
-                    'VERMOD-Active-text', 'VERMOD-Armed-text', 'VERMOD-Reference-text',
144
-                    'AltBigC', 'AltSmallC'
124
+                'SelectedALT-text',
125
+                'TAS-text',
126
+                'GSPD-text',
127
+                'TIME-text',
128
+                'OAT-text',
129
+                'VSIText',
130
+                'Speed110',
131
+                'Alt11100',
132
+                'HDG-text',
133
+                'BARO-text',
134
+                'CDI-SRC-text', 'CDI-GPS-ANN-text', 'CDI-GPS-XTK-text',
135
+                'BRG1-pointer', 'BRG1-SRC-text', 'BRG1-DST-text', 'BRG1-WPID-text',
136
+                'BRG2-pointer', 'BRG2-SRC-text', 'BRG2-DST-text', 'BRG2-WPID-text',
137
+                'WindData-OPTN1-HDG-text', 'WindData-OPTN1-SPD-text',
138
+                'WindData-OPTN2-crosswind-text', 'WindData-OPTN2-headwind-text',
139
+                'XPDR-MODE-text', 'XPDR-DIGIT-3-text', 'XPDR-DIGIT-2-text', 'XPDR-DIGIT-1-text', 'XPDR-DIGIT-0-text',
140
+                'ETE', 'ETE-text', 'DIS', 'DIS-text', 'LEG-text',
141
+                'LATMOD-Armed-text', 'LATMOD-Active-text',
142
+                'AP-Status-text', 'YD-Status-text',
143
+                'VERMOD-Active-text', 'VERMOD-Armed-text', 'VERMOD-Reference-text',
144
+                'AltBigC', 'AltSmallC'
145 145
 # }}}
146
+            );
147
+            for (var place = 1; place <= 6; place +=1) {
148
+                append(groups.text,
149
+                    'AltBigU' ~ place,
150
+                    'AltSmallU' ~ place,
151
+                    'AltBigD' ~ place,
152
+                    'AltSmallD' ~ place
146 153
                 );
147
-                for (var place = 1; place <= 6; place +=1) {
148
-                    append(groups.text,
149
-                        'AltBigU' ~ place,
150
-                        'AltSmallU' ~ place,
151
-                        'AltBigD' ~ place,
152
-                        'AltSmallD' ~ place
153
-                    );
154
-                }
155
-                canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Models/PFD.svg');
156 154
             }
157
-            else {
158
-                var eis_file = eis.getValue('type');
159
-                if (eis_file == nil)
160
-                    eis_file = eis.getValue('file');
161
-
162
-                if (eis_file != nil) {
163
-                    if (find('/', eis_file) == -1)
164
-                        eis_file = data.zkv1000_dir ~ 'Nasal/EIS/' ~ eis_file ~ '.nas';
165
-                    elsif (split('/', eis_file)[0] == 'Aircraft') {
166
-                        var path = split('/', eis_file);
167
-                        if (getprop('/sim/fg-aircraft') != nil) {
168
-                            eis_file = getprop('/sim/fg-aircraft');
169
-                            for (var i = 1; i < size(path); i += 1)
170
-                                eis_file ~= '/' ~ path[i];
171
-                        }
172
-                        else
173
-                            eis_file = getprop('/sim/fg-root') ~ '/' ~ eis_file;
155
+            canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Models/PFD.svg');
156
+        }
157
+        else {
158
+            var eis_file = eis.getValue('type');
159
+            if (eis_file == nil)
160
+                eis_file = eis.getValue('file');
161
+
162
+            if (eis_file != nil) {
163
+                if (find('/', eis_file) == -1)
164
+                    eis_file = data.zkv1000_dir ~ 'Nasal/EIS/' ~ eis_file ~ '.nas';
165
+                elsif (split('/', eis_file)[0] == 'Aircraft') {
166
+                    var path = split('/', eis_file);
167
+                    if (getprop('/sim/fg-aircraft') != nil) {
168
+                        eis_file = getprop('/sim/fg-aircraft');
169
+                        for (var i = 1; i < size(path); i += 1)
170
+                            eis_file ~= '/' ~ path[i];
174 171
                     }
172
+                    else
173
+                        eis_file = getprop('/sim/fg-root') ~ '/' ~ eis_file;
175 174
                 }
176
-                else
177
-                    eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas';
175
+            }
176
+            else
177
+                eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas';
178 178
 
179
-                if (io.stat(eis_file) == nil
180
-                and print(eis_file ~ ' not found'))
181
-                    eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas';
182
-                io.load_nasal(eis_file, 'zkv1000');
179
+            if (io.stat(eis_file) == nil
180
+            and print(eis_file ~ ' not found'))
181
+                eis_file = data.zkv1000_dir ~ 'Nasal/EIS/none.nas';
182
+            io.load_nasal(eis_file, 'zkv1000');
183 183
 
184
-                if (contains(m.parents[0], 'showEIS'))
185
-                    m.showEIS(groups);
184
+            if (contains(m.parents[0], 'showEIS'))
185
+                m.showEIS(groups);
186 186
 
187
-                append(groups.hide, 'PFD-navbox');
188
-                for (var i=1; i <= 4; i+=1)
189
-                    foreach (var t; ['ID', 'VAL'])
190
-                        append(groups.text, 'DATA-FIELD' ~ i ~ '-' ~ t ~ '-text');
191
-            }
187
+            append(groups.hide, 'PFD-navbox');
188
+            for (var i=1; i <= 4; i+=1)
189
+                foreach (var t; ['ID', 'VAL'])
190
+                    append(groups.text, 'DATA-FIELD' ~ i ~ '-' ~ t ~ '-text');
191
+        }
192 192
 
193
-            canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Models/softkeys.svg');
194
-            canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Models/header-nav-comm.svg');
193
+        canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Models/softkeys.svg');
194
+        canvas.parsesvg(m.screen, data.zkv1000_reldir ~ 'Models/header-nav-comm.svg');
195 195
 
196
-            m.loadGroup(groups);
196
+        m.loadGroup(groups);
197 197
 
198
-            if (m.device.role == 'PFD') {
199
-                m.device.data.aoa = 0;
200
-                m.device.data['aoa-auto'] = 0;
201
-                m.device.data.mapclip = {
202
-                    top: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[1]) - 1,
203
-                    right: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[2]) - 1,
204
-                    bottom: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[3]) - 1,
205
-                    left: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[0]) - 1,
206
-                };
207
-            }
208
-            else {
209
-                m.device.data.mapclip = {
210
-                    top: math.ceil(m.screenElements['Header'].getTransformedBounds()[3]),
211
-                    right: m.display.get('view[0]'),
212
-                    bottom: math.ceil(m.screenElements['SoftKeysTexts'].getTransformedBounds()[1]),
213
-                    left: contains(m.screenElements, 'EIS') ? math.ceil(m.screenElements['EIS'].getTransformedBounds()[2]) : 0,
214
-                };
215
-            }
198
+        if (m.device.role == 'PFD') {
199
+            m.device.data.aoa = 0;
200
+            m.device.data['aoa-auto'] = 0;
201
+            m.device.data.mapclip = {
202
+                top: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[1]) - 1,
203
+                right: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[2]) - 1,
204
+                bottom: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[3]) - 1,
205
+                left: math.ceil(m.screenElements['PFD-Map-bg'].getTransformedBounds()[0]) - 1,
206
+            };
207
+        }
208
+        else {
209
+            m.device.data.mapclip = {
210
+                top: math.ceil(m.screenElements['Header'].getTransformedBounds()[3]),
211
+                right: m.display.get('view[0]'),
212
+                bottom: math.ceil(m.screenElements['SoftKeysTexts'].getTransformedBounds()[1]),
213
+                left: contains(m.screenElements, 'EIS') ? math.ceil(m.screenElements['EIS'].getTransformedBounds()[2]) : 0,
214
+            };
215
+        }
216 216
         return m;
217 217
     },
218 218
 #}}}