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 "Screen/SingleWindow.hpp"
25 #include "Screen/Init.hpp"
26 #include "Dialogs/Dialogs.h"
27 #include "UtilsSystem.hpp"
28 #include "LocalPath.hpp"
29 #include "WayPointParser.h"
30 #include "Airspace/AirspaceClientUI.hpp"
31 #include "TaskClientUI.hpp"
32 #include "Task/TaskManager.hpp"
33 #include "InfoBoxes/InfoBoxLayout.hpp"
34 #include "Interface.hpp"
35 #include "Blackboard/DeviceBlackboard.hpp"
36 #include "Logger/Logger.hpp"
37 #include "Engine/Airspace/Airspaces.hpp"
38 #include "Engine/Airspace/AirspaceWarningManager.hpp"
39 #include "LocalPath.hpp"
40 #include "Look/Fonts.hpp"
46 DeviceBlackboard::SetStartupLocation(const GeoPoint
&loc
,
51 Projection::Projection() {}
53 static RasterTerrain terrain
;
56 InterfaceBlackboard
CommonInterface::blackboard
;
60 void Logger::LoggerDeviceDeclare() {}
62 void RasterTerrain::Lock() {}
63 void RasterTerrain::Unlock() {}
65 void dlgAnalysisShowModal() {}
66 void dlgTaskCalculatorShowModal(SingleWindow
&parent
) {}
69 static TaskBehaviour task_behaviour
;
70 static TaskEvents task_events
;
71 static TaskManager
task_manager(task_events
, task_behaviour
, way_points
);
73 static Airspaces airspace_database
;
75 static AirspaceWarningManager
airspace_warning(airspace_database
,
78 AirspaceClientUI
airspace_ui(airspace_database
, airspace_warning
);
83 WayPointParser::ReadWaypoints(way_points
, &terrain
);
87 CreateDefaultTask(TaskManager
&task_manager
, const Waypoints
&way_points
)
89 const TCHAR start_name
[] = _T("Bergneustadt");
91 task_manager
.set_factory(OrderedTask::FactoryType::MIXED
);
92 AbstractTaskFactory
&factory
= task_manager
.GetFactory();
97 wp
= way_points
.lookup_name(start_name
);
99 tp
= factory
.createStart(AbstractTaskFactory::START_LINE
, *wp
);
100 if (!factory
.append(tp
, false)) {
101 fprintf(stderr
, "Failed to create start point\n");
104 fprintf(stderr
, "No start waypoint\n");
107 wp
= way_points
.lookup_name(_T("Uslar"));
109 tp
= factory
.createIntermediate(AbstractTaskFactory::AST_CYLINDER
, *wp
);
110 if (!factory
.append(tp
, false)) {
111 fprintf(stderr
, "Failed to create turn point\n");
114 fprintf(stderr
, "No turn point\n");
117 wp
= way_points
.lookup_name(_T("Suhl Goldlaut"));
119 tp
= factory
.createIntermediate(AbstractTaskFactory::AST_CYLINDER
, *wp
);
120 if (!factory
.append(tp
, false)) {
121 fprintf(stderr
, "Failed to create turn point\n");
124 fprintf(stderr
, "No turn point\n");
127 wp
= way_points
.lookup_name(start_name
);
129 tp
= factory
.createFinish(AbstractTaskFactory::FINISH_LINE
, *wp
);
130 if (!factory
.append(tp
, false)) {
131 fprintf(stderr
, "Failed to create finish point\n");
134 fprintf(stderr
, "No finish waypoint\n");
139 int main(int argc
, char **argv
)
142 WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
,
151 InitialiseDataPath();
152 ScreenGlobalInit screen_init
;
156 CreateDefaultTask(task_manager
, way_points
);
158 SingleWindow main_window
;
159 main_window
.set(_T("STATIC"), _T("RunTaskEditorDialog"),
161 ((Window
&)main_window
).InstallWndProc();
166 dlgTaskOverviewShowModal(main_window
);
168 Fonts::Deinitialize();
169 DeinitialiseDataPath();