CustomAircraftMarkers.js   A
last analyzed

Complexity

Total Complexity 26
Complexity/F 1.24

Size

Lines of Code 305
Function Count 21

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
wmc 26
nc 230686721
mnd 2
bc 23
fnc 21
dl 0
loc 305
rs 10
bpm 1.0952
cpm 1.238
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B VRS.globalDispatch.hook 0 303 3
1
/** global: VRS */
2
if (typeof VRS === "undefined" && VRS.globalDispatch && VRS.serverConfig) {
3
	VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function() {
4
		if (VRS.globalOptions && VRS.globalOptions.aircraftMarkers) {
5
			
6
                /////////////////////////////
7
                /* WTC LIGHT 1 PROP - MLAT */
8
                /////////////////////////////
9
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
10
                    normalFileName: 'M-WTC-Light-1-Prop.png',
11
                    selectedFileName: 'M-WTC-Light-1-Prop-Selected.png',
12
                    size: {
13
                        width: 32,
14
                        height: 32
15
                    },
16
                    matches: function( /** VRS.Aircraft */ aircraft) {
17
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Light && aircraft.countEngines.val === '1' && aircraft.engineType.val === VRS.EngineType.Turbo && aircraft.isMlat.val;
18
                    }
19
                }));
20
21
                /////////////////////////////
22
                /* WTC LIGHT 2 PROP - MLAT */
23
                /////////////////////////////
24
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
25
                    normalFileName: 'M-WTC-Light-2-Prop.png',
26
                    selectedFileName: 'M-WTC-Light-2-Prop-Selected.png',
27
                    size: {
28
                        width: 40,
29
                        height: 40
30
                    },
31
                    matches: function( /** VRS.Aircraft */ aircraft) {
32
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Light && aircraft.countEngines.val === '2' && aircraft.engineType.val === VRS.EngineType.Turbo && aircraft.isMlat.val;
33
                    }
34
                }));
35
36
                ///////////////////////////////
37
                /* WTC MEDIUM 2 TURBO - MLAT */
38
                ///////////////////////////////
39
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
40
                    normalFileName: 'M-WTC-Medium-2-Turbo.png',
41
                    selectedFileName: 'M-WTC-Medium-2-Turbo-Selected.png',
42
                    size: {
43
                        width: 40,
44
                        height: 40
45
                    },
46
                    matches: function( /** VRS.Aircraft */ aircraft) {
47
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Medium && aircraft.countEngines.val === '2' && aircraft.engineType.val === VRS.EngineType.Turbo && aircraft.isMlat.val;
48
                    }
49
                }));
50
51
                ////////////////////////////
52
                /* WTC LIGHT 2 JET - MLAT */
53
                ////////////////////////////
54
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
55
                    normalFileName: 'M-Type-GLFx.png',
56
                    selectedFileName: 'M-Type-GLFx-Selected.png',
57
                    size: {
58
                        width: 40,
59
                        height: 40
60
                    },
61
                    matches: function( /** VRS.Aircraft */ aircraft) {
62
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Light && aircraft.countEngines.val === '2' && aircraft.engineType.val === VRS.EngineType.Jet && aircraft.isMlat.val;
63
                    }
64
                }));
65
66
                /////////////////////////////
67
                /* WTC MEDIUM 2 JET - MLAT */
68
                /////////////////////////////
69
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
70
                    normalFileName: 'M-WTC-Medium-2-Jet.png',
71
                    selectedFileName: 'M-WTC-Medium-2-Jet-Selected.png',
72
                    size: {
73
                        width: 40,
74
                        height: 40
75
                    },
76
                    matches: function( /** VRS.Aircraft */ aircraft) {
77
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Medium && aircraft.countEngines.val === '2' && aircraft.engineType.val === VRS.EngineType.Jet && aircraft.isMlat.val;
78
                    }
79
                }));
80
		
81
		///////////////////////////////////////////////////////////
82
                /* GALX, G200, CL30, CL35, CL60, C56X, C750, GLF2, GLF3 - MLAT */
83
                ///////////////////////////////////////////////////////////
84
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
85
                    normalFileName: 'M-Type-GLFx.png',
86
                    selectedFileName: 'M-Type-GLFx-Selected.png',
87
                    size: {
88
                        width: 40,
89
                        height: 40
90
                    },
91
                    matches: function( /** VRS.Aircraft */ aircraft) {
92
                        return aircraft.modelIcao.val === 'GALX' || aircraft.modelIcao.val === 'G150' || aircraft.modelIcao.val === 'G200' || aircraft.modelIcao.val === 'CL30' || aircraft.modelIcao.val === 'CL35' || aircraft.modelIcao.val === 'CL60' || aircraft.modelIcao.val === 'C680' || aircraft.modelIcao.val === 'C750' || aircraft.modelIcao.val === 'C56X' || aircraft.modelIcao.val === 'BE40' || aircraft.modelIcao.val === 'LJ31' || aircraft.modelIcao.val === 'LJ45' || aircraft.modelIcao.val === 'LJ60' && aircraft.isMlat.val;
93
                    }
94
                }));
95
96
                ///////////////////////////////////
97
                /* WTC MEDIUM 4 TURBOPROP - MLAT */
98
                ///////////////////////////////////
99
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
100
                    normalFileName: 'M-4-TurboProp.png',
101
                    selectedFileName: 'M-4-TurboProp-Selected.png',
102
                    size: {
103
                        width: 40,
104
                        height: 40
105
                    },
106
                    matches: function( /** VRS.Aircraft */ aircraft) {
107
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Medium && aircraft.countEngines.val === '4' && aircraft.engineType.val === VRS.EngineType.Turbo && aircraft.isMlat.val;
108
                    }
109
                }));
110
111
                ///////////////////////////////////////////////////////////////////////
112
                /* GLEX, GL5T, GLF4, GLF5, GLF6, F2TH, FA5X, FA7X, FA50, F900 - MLAT */
113
                ///////////////////////////////////////////////////////////////////////
114
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
115
                    normalFileName: 'M-GLEX.png',
116
                    selectedFileName: 'M-GLEX-Selected.png',
117
                    size: {
118
                        width: 40,
119
                        height: 40
120
                    },
121
                    matches: function( /** VRS.Aircraft */ aircraft) {
122
                        return aircraft.modelIcao.val === 'GLEX' || aircraft.modelIcao.val === 'GL5T' || aircraft.modelIcao.val === 'GLF4' || aircraft.modelIcao.val === 'GLF5' || aircraft.modelIcao.val === 'GLF6' || aircraft.modelIcao.val === 'F2TH' || aircraft.modelIcao.val === 'FA5X' || aircraft.modelIcao.val === 'FA50' || aircraft.modelIcao.val === 'F900' || aircraft.modelIcao.val === 'FA7X' && aircraft.isMlat.val;
123
                    }
124
                }));
125
                ////////////////////////////////////////////////////////////////
126
                /* GLEX, GL5T, GLF4, GLF5, GLF6, F2TH, FA5X, FA7X, FA50, F900 */
127
                ////////////////////////////////////////////////////////////////
128
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
129
                    normalFileName: 'GLEX.png',
130
                    selectedFileName: 'GLEX-Selected.png',
131
                    size: {
132
                        width: 40,
133
                        height: 40
134
                    },
135
                    matches: function( /** VRS.Aircraft */ aircraft) {
136
                        return aircraft.modelIcao.val === 'GLEX' || aircraft.modelIcao.val === 'GL5T' || aircraft.modelIcao.val === 'GLF4' || aircraft.modelIcao.val === 'GLF5' || aircraft.modelIcao.val === 'GLF6' || aircraft.modelIcao.val === 'F2TH' || aircraft.modelIcao.val === 'FA5X' || aircraft.modelIcao.val === 'FA7X' || aircraft.modelIcao.val === 'FA50' || aircraft.modelIcao.val === 'F900';
137
                    }
138
                }));
139
140
                /////////////////////////////
141
                /* E135, E35L, E145 - MLAT */
142
                /////////////////////////////
143
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
144
                    normalFileName: 'M-E135.png',
145
                    selectedFileName: 'M-E135-Selected.png',
146
                    size: {
147
                        width: 40,
148
                        height: 40
149
                    },
150
                    matches: function( /** VRS.Aircraft */ aircraft) {
151
                        return aircraft.modelIcao.val === 'E135' || aircraft.modelIcao.val === 'E35L' || aircraft.modelIcao.val === 'E145' && aircraft.isMlat.val;
152
                    }
153
                }));
154
                //////////////////////
155
                /* E135, E35L, E145 */
156
                //////////////////////
157
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
158
                    normalFileName: 'E135.png',
159
                    selectedFileName: 'E135-Selected.png',
160
                    size: {
161
                        width: 40,
162
                        height: 40
163
                    },
164
                    matches: function( /** VRS.Aircraft */ aircraft) {
165
                        return aircraft.modelIcao.val === 'E135' || aircraft.modelIcao.val === 'E35L' || aircraft.modelIcao.val === 'E145';
166
                    }
167
                }));
168
169
                ///////////////////
170
                /* KC-390 - MLAT */
171
                ///////////////////
172
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
173
                    normalFileName: 'M-E39.png',
174
                    selectedFileName: 'M-E39-Selected.png',
175
                    size: {
176
                        width: 40,
177
                        height: 40
178
                    },
179
                    matches: function( /** VRS.Aircraft */ aircraft) {
180
                        return aircraft.modelIcao.val === 'KC39' && aircraft.isMlat.val;
181
                    }
182
                }));
183
184
                ////////////
185
                /* KC-390 */
186
                ////////////
187
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
188
                    normalFileName: 'E39.png',
189
                    selectedFileName: 'E39-Selected.png',
190
                    size: {
191
                        width: 40,
192
                        height: 40
193
                    },
194
                    matches: function( /** VRS.Aircraft */ aircraft) {
195
                        return aircraft.modelIcao.val === 'KC39';
196
                    }
197
                }));
198
199
                /////////////////////////////
200
                /* WTC MEDIUM 4 JET - MLAT */
201
                /////////////////////////////
202
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
203
                    normalFileName: 'M-WTC-Medium-4-Jet.png',
204
                    selectedFileName: 'M-WTC-Medium-4-Jet-Selected.png',
205
                    size: {
206
                        width: 40,
207
                        height: 40
208
                    },
209
                    matches: function( /** VRS.Aircraft */ aircraft) {
210
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Medium && aircraft.countEngines.val === '4' && aircraft.engineType.val === VRS.EngineType.Jet && aircraft.isMlat.val;
211
                    }
212
                }));
213
214
                ////////////////////////////
215
                /* WTC HEAVY 2 JET - MLAT */
216
                ////////////////////////////
217
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
218
                    normalFileName: 'M-WTC-Heavy-2-Jet.png',
219
                    selectedFileName: 'M-WTC-Heavy-2-Jet-Selected.png',
220
                    size: {
221
                        width: 40,
222
                        height: 40
223
                    },
224
                    matches: function( /** VRS.Aircraft */ aircraft) {
225
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Heavy && aircraft.countEngines.val === '2' && aircraft.engineType.val === VRS.EngineType.Jet && aircraft.isMlat.val;
226
                    }
227
                }));
228
229
                ////////////////////////////
230
                /* WTC HEAVY 4 JET - MLAT */
231
                ////////////////////////////
232
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
233
                    normalFileName: 'M-WTC-Heavy-4-Jet.png',
234
                    selectedFileName: 'M-WTC-Heavy-4-Jet-Selected.png',
235
                    size: {
236
                        width: 60,
237
                        height: 60
238
                    },
239
                    matches: function( /** VRS.Aircraft */ aircraft) {
240
                        return aircraft.wakeTurbulenceCat.val === VRS.WakeTurbulenceCategory.Heavy && aircraft.countEngines.val === '4' && aircraft.engineType.val === VRS.EngineType.Jet && aircraft.isMlat.val;
241
                    }
242
                }));
243
244
                /////////////////
245
                /* A380 - MLAT */
246
                /////////////////
247
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
248
                    normalFileName: 'M-Type-A380.png',
249
                    selectedFileName: 'M-Type-A380-Selected.png',
250
                    size: {
251
                        width: 60,
252
                        height: 60
253
                    },
254
                    matches: function( /** VRS.Aircraft */ aircraft) {
255
                        return aircraft.modelIcao.val === 'A124' || aircraft.modelIcao.val === 'A380' || aircraft.modelIcao.val === 'A388' && aircraft.isMlat.val;
256
                    }
257
                }));
258
259
                /////////////////
260
                /* A225 - MLAT */
261
                /////////////////
262
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
263
                    normalFileName: 'M-A225.png',
264
                    selectedFileName: 'M-A225-Selected.png',
265
                    size: {
266
                        width: 60,
267
                        height: 60
268
                    },
269
                    matches: function( /** VRS.Aircraft */ aircraft) {
270
                        return aircraft.modelIcao.val === 'A225' && aircraft.isMlat.val;
271
                    }
272
                }));
273
274
                //////////
275
                /* A225 */
276
                //////////
277
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
278
                    normalFileName: 'A225.png',
279
                    selectedFileName: 'A225-Selected.png',
280
                    size: {
281
                        width: 60,
282
                        height: 60
283
                    },
284
                    matches: function( /** VRS.Aircraft */ aircraft) {
285
                        return aircraft.modelIcao.val === 'A225';
286
                    }
287
                }));
288
289
                ////////////////////////
290
                /* HELICOPTERS - MLAT */
291
                ////////////////////////
292
                VRS.globalOptions.aircraftMarkers.unshift(new VRS.AircraftMarker({
293
                    normalFileName: 'M-Helicopter.png',
294
                    selectedFileName: 'M-Helicopter-Selected.png',
295
                    size: {
296
                        width: 32,
297
                        height: 32
298
                    },
299
                    matches: function( /** VRS.Aircraft */ aircraft) {
300
                        return aircraft.modelIcao.val === 'AS50' || aircraft.modelIcao.val === 'AS65' || aircraft.modelIcao.val === 'B06' || aircraft.modelIcao.val === 'EC20' || aircraft.modelIcao.val === 'EC35' || aircraft.modelIcao.val === 'EC45' || aircraft.modelIcao.val === 'R22' || aircraft.modelIcao.val === 'R44' || aircraft.modelIcao.val === 'R66' || aircraft.modelIcao.val === 'S76' && aircraft.isMlat.val;
301
                        //return aircraft.species.val === VRS.Species.Helicopter && aircraft.isMlat.val
302
                    }
303
                }));
304
		}
305
	});
306
}
307