android/GlueIOIOPort: fix spurious errors after IOIO baud rate change
[xcsoar.git] / src / MapSettings.hpp
blob4b75186b2c327866db9ee47e16f11d8e3a92f92b
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef XCSOAR_MAP_SETTINGS_HPP
25 #define XCSOAR_MAP_SETTINGS_HPP
27 // changed only in config or by user interface
28 // not expected to be used by other threads
30 #include "Airspace/AirspaceClass.hpp"
31 #include "Renderer/AirspaceRendererSettings.hpp"
32 #include "Renderer/WaypointRendererSettings.hpp"
33 #include "Terrain/TerrainSettings.hpp"
34 #include "Math/fixed.hpp"
36 #include <type_traits>
38 #include <stdint.h>
40 enum class AircraftSymbol : uint8_t {
41 SIMPLE,
42 DETAILED,
43 SIMPLE_LARGE,
44 HANGGLIDER,
45 PARAGLIDER,
48 enum class DisplayOrientation : uint8_t {
49 TRACK_UP,
50 NORTH_UP,
51 TARGET_UP,
52 HEADING_UP,
53 WIND_UP,
56 enum class MapShiftBias : uint8_t {
57 NONE,
58 TRACK,
59 TARGET
62 enum class DisplayGroundTrack: uint8_t {
63 OFF,
64 ON,
65 AUTO,
68 enum class FinalGlideBarDisplayMode: uint8_t {
69 OFF,
70 ON,
71 AUTO,
74 struct MapItemListSettings {
76 /** Add an LocationMapItem to the MapItemList? */
77 bool add_location;
79 /** Add an ArrivalAltitudeMapItem to the MapItemList? */
80 bool add_arrival_altitude;
82 void SetDefaults();
85 static_assert(std::is_trivial<MapItemListSettings>::value, "type is not trivial");
87 struct TrailSettings {
88 /** Snailtrail wind drifting in circling mode */
89 bool wind_drift_enabled;
90 bool scaling_enabled;
92 /** 0: standard, 1: seeyou colors */
93 enum class Type: uint8_t {
94 VARIO_1,
95 VARIO_2,
96 ALTITUDE,
97 VARIO_1_DOTS,
98 VARIO_2_DOTS,
99 VARIO_DOTS_AND_LINES,
100 } type;
102 enum class Length: uint8_t {
103 OFF,
104 LONG,
105 SHORT,
106 FULL,
107 } length;
109 void SetDefaults();
112 static_assert(std::is_trivial<TrailSettings>::value, "type is not trivial");
114 // user interface options
116 // where using these from Calculations or MapWindow thread, should
117 // protect
119 enum class WindArrowStyle: uint8_t {
120 ARROW_HEAD,
121 FULL_ARROW,
122 NO_ARROW,
125 struct MapSettings {
126 /** Map zooms in on circling */
127 bool circle_zoom_enabled;
128 /** Maximum distance limit for AutoZoom */
129 fixed max_auto_zoom_distance;
130 /** Map will show topography */
131 bool topography_enabled;
133 TerrainRendererSettings terrain;
135 AircraftSymbol aircraft_symbol;
137 /** Indicate extra distance reqd. if deviating from target heading */
138 bool detour_cost_markers_enabled;
139 /** Render track bearing on map */
140 DisplayGroundTrack display_ground_track;
142 /** Automatic zoom when closing in on waypoint */
143 bool auto_zoom_enabled;
144 WindArrowStyle wind_arrow_style;
146 WaypointRendererSettings waypoint;
147 AirspaceRendererSettings airspace;
149 int glider_screen_position;
150 /** Orientation of the map (North up, Track up, etc.) */
151 DisplayOrientation cruise_orientation;
152 DisplayOrientation circling_orientation;
154 /** Map scale in cruise mode [px/m] */
155 fixed cruise_scale;
156 /** Map scale in circling mode [px/m] */
157 fixed circling_scale;
159 /** The bias for map shifting (Heading, Target, etc.) */
160 MapShiftBias map_shift_bias;
162 bool show_flarm_on_map;
165 * This is an inverted copy of TrafficSettings::enable_gauge. The
166 * map should not render the FLARM alarm level if the gauge already
167 * shows it, to declutter the map. The copy is needed because
168 * MapWindowBlackboard only knows MapSettings, but not
169 * TrafficSettings, and DrawThread is not allowed to access
170 * InterfaceBlackboard.
172 bool show_flarm_alarm_level;
174 /** Display climb band on map */
175 bool show_thermal_profile;
177 /** Show FinalGlideBar mc0 arrow */
178 bool final_glide_bar_mc0_enabled;
180 /** FinalGlideBar display mode configuration */
181 FinalGlideBarDisplayMode final_glide_bar_display_mode;
183 /** Show Vario Bar arrow */
184 bool vario_bar_enabled;
187 * Overlay FAI triangle areas on the map while flying?
189 bool show_fai_triangle_areas;
191 TrailSettings trail;
192 MapItemListSettings item_list;
194 void SetDefaults();
197 static_assert(std::is_trivial<MapSettings>::value, "type is not trivial");
199 #endif