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 #include "Profile/TaskProfile.hpp"
25 #include "Profile/RouteProfile.hpp"
26 #include "Profile/Profile.hpp"
27 #include "Task/TaskBehaviour.hpp"
30 static void Load(GlideSettings
&settings
);
31 static void Load(TaskStartMargins
&settings
);
32 static void Load(SectorDefaults
&settings
);
33 static void Load(StartConstraints
&constraints
);
34 static void Load(FinishConstraints
&constraints
);
35 static void Load(OrderedTaskBehaviour
&settings
);
39 Profile::Load(GlideSettings
&settings
)
41 Get(ProfileKeys::PredictWindDrift
, settings
.predict_wind_drift
);
45 Profile::Load(TaskStartMargins
&settings
)
47 Get(ProfileKeys::StartMaxHeightMargin
, settings
.max_height_margin
);
48 Get(ProfileKeys::StartMaxSpeedMargin
, settings
.max_speed_margin
);
52 Profile::Load(SectorDefaults
&settings
)
54 GetEnum(ProfileKeys::StartType
, settings
.start_type
);
55 Get(ProfileKeys::StartRadius
, settings
.start_radius
);
56 GetEnum(ProfileKeys::TurnpointType
, settings
.turnpoint_type
);
57 Get(ProfileKeys::TurnpointRadius
, settings
.turnpoint_radius
);
58 GetEnum(ProfileKeys::FinishType
, settings
.finish_type
);
59 Get(ProfileKeys::FinishRadius
, settings
.finish_radius
);
63 Profile::Load(StartConstraints
&constraints
)
65 GetEnum(ProfileKeys::StartHeightRef
, constraints
.max_height_ref
);
66 Get(ProfileKeys::StartMaxHeight
, constraints
.max_height
);
67 Get(ProfileKeys::StartMaxSpeed
, constraints
.max_speed
);
71 Profile::Load(FinishConstraints
&constraints
)
73 GetEnum(ProfileKeys::FinishHeightRef
, constraints
.min_height_ref
);
74 Get(ProfileKeys::FinishMinHeight
, constraints
.min_height
);
78 Profile::Load(OrderedTaskBehaviour
&settings
)
80 Load(settings
.start_constraints
);
81 Load(settings
.finish_constraints
);
82 Get(ProfileKeys::AATMinTime
, settings
.aat_min_time
);
86 Profile::Load(TaskBehaviour
&settings
)
90 Get(ProfileKeys::AATTimeMargin
, settings
.optimise_targets_margin
);
91 Get(ProfileKeys::AutoMc
, settings
.auto_mc
);
92 GetEnum(ProfileKeys::AutoMcMode
, settings
.auto_mc_mode
);
95 if (Get(ProfileKeys::RiskGamma
, Temp
))
96 settings
.risk_gamma
= fixed(Temp
) / 10;
98 if (Get(ProfileKeys::SafetyMacCready
, Temp
))
99 settings
.safety_mc
= fixed(Temp
) / 10;
101 Get(ProfileKeys::SafetyAltitudeArrival
, settings
.safety_height_arrival
);
102 GetEnum(ProfileKeys::TaskType
, settings
.task_type_default
);
103 Load(settings
.start_margins
);
105 Load(settings
.sector_defaults
);
106 Load(settings
.ordered_defaults
);
108 GetEnum(ProfileKeys::AbortTaskMode
, settings
.abort_task_mode
);
110 Load(settings
.route_planner
);