1# Copyright 2018 Stuart Buchanan
2# This file is part of FlightGear.
3#
4# FlightGear is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 2 of the License, or
7# (at your option) any later version.
8#
9# FlightGear is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with FlightGear.  If not, see <http://www.gnu.org/licenses/>.
16#
17# Navigation Map Styles
18var NavigationMapStyles =
19{
20  new : func() {
21    var obj = { parents : [ NavigationMapStyles ]};
22    obj.Styles = {};
23    obj.loadStyles();
24    return obj;
25  },
26
27  getStyle : func(type) {
28    return me.Styles[type];
29  },
30
31  setStyle : func(type, name, value) {
32    me.Styles[type][name] = value;
33  },
34
35  loadStyles : func() {
36    me. clearStyles();
37    me.Styles.DME = {};
38    me.Styles.DME.debug = 1; # HACK for benchmarking/debugging purposes
39    me.Styles.DME.animation_test = 0; # for prototyping animated symbols
40
41    me.Styles.DME.scale_factor = 0.4; # 40% (applied to whole group)
42    me.Styles.DME.line_width = 3.0;
43    me.Styles.DME.color_tuned = [0,1,0]; #rgb
44    me.Styles.DME.color_default = [1,1,0];  #rgb
45
46    me.Styles.APT = {};
47    me.Styles.APT.scale_factor = 0.4; # 40% (applied to whole group)
48    me.Styles.APT.line_width = 3.0;
49    me.Styles.APT.color_default = [0,0.6,0.85];  #rgb
50    me.Styles.APT.label_font_color = me.Styles.APT.color_default;
51    me.Styles.APT.label_font_size=28;
52
53    me.Styles.TFC = {};
54    me.Styles.TFC.scale_factor = 0.4; # 40% (applied to whole group)
55
56    me.Styles.WPT = {};
57    me.Styles.WPT.scale_factor = 0.5; # 50% (applied to whole group)
58
59    me.Styles.RTE = {};
60    me.Styles.RTE.line_width = 2;
61
62    me.Styles.FLT = {};
63    me.Styles.FLT.line_width = 3;
64
65    me.Styles.FIX = {};
66    me.Styles.FIX.color = [0,0,0];  # Black outline
67    me.Styles.FIX.fill_color = [1,1,1,1]; # White fill
68    me.Styles.FIX.scale_factor = 0.5; # 50%
69
70    me.Styles.FIX.text_offset = [0, -12];
71    me.Styles.FIX.text_color = [0,0,0,1]; # Black text ...
72    me.Styles.FIX.text_bgcolor = [1,1,1,1]; # ... on a white background
73    me.Styles.FIX.text_mode = canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX;
74    me.Styles.FIX.text_padding = 2;
75    me.Styles.FIX.text_alignment = 'center-bottom';
76
77    me.Styles.NDB = {};
78    me.Styles.NDB.scale_factor = 0.5; # 60%
79    me.Styles.NDB.dash_array = [1,1];
80    me.Styles.NDB.text_offset = [0, -12];
81    me.Styles.NDB.text_color = [0,0,0,1]; # Black text ...
82    me.Styles.NDB.text_bgcolor = [1,1,1,1]; # ... on a white background
83    me.Styles.NDB.text_mode = canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX;
84    me.Styles.NDB.text_padding = 2;
85    me.Styles.NDB.text_alignment = 'center-bottom';
86
87    me.Styles.VOR_FG1000 = {};
88    me.Styles.VOR_FG1000.line_width = 1;
89    me.Styles.VOR_FG1000.scale_factor = 1.0;
90    me.Styles.VOR_FG1000.circle_radius = 128;
91    me.Styles.VOR_FG1000.icon_color = [0.0,0.0,0.5];
92    me.Styles.VOR_FG1000.circle_color = [0.2,0.8,0.8];
93    me.Styles.VOR_FG1000.text_offset = [0, -12];
94    me.Styles.VOR_FG1000.text_color = [0,0,0,1]; # Black text ...
95    me.Styles.VOR_FG1000.text_bgcolor = [1,1,1,1]; # ... on a white background
96    me.Styles.VOR_FG1000.text_mode = canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX;
97    me.Styles.VOR_FG1000.text_padding = 2;
98    me.Styles.VOR_FG1000.text_alignment = 'center-bottom';
99    me.Styles.VOR_FG1000.font_size = 14;
100
101    me.Styles.APS = {};
102    me.Styles.APS.scale_factor=0.3;
103    me.Styles.APS.svg_path = "Aircraft/Instruments-3d/FG1000/Icons/APSmodel.svg";
104  },
105
106  clearStyles : func() {
107    me.Styles = {};
108  },
109
110};
111