本文整理汇总了C++中OrderedTask::CheckDuplicateWaypoints方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTask::CheckDuplicateWaypoints方法的具体用法?C++ OrderedTask::CheckDuplicateWaypoints怎么用?C++ OrderedTask::CheckDuplicateWaypoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedTask
的用法示例。
在下文中一共展示了OrderedTask::CheckDuplicateWaypoints方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartupLogFreeRamAndStorage
static void
AfterStartup()
{
StartupLogFreeRamAndStorage();
if (is_simulator()) {
InputEvents::processGlideComputer(GCE_STARTUP_SIMULATOR);
} else {
InputEvents::processGlideComputer(GCE_STARTUP_REAL);
}
OrderedTask *defaultTask = LoadDefaultTask(CommonInterface::GetComputerSettings().task,
&way_points);
if (defaultTask) {
{
ScopeSuspendAllThreads suspend;
defaultTask->CheckDuplicateWaypoints(way_points);
way_points.Optimise();
}
protected_task_manager->TaskCommit(*defaultTask);
delete defaultTask;
}
task_manager->Resume();
#ifdef USE_GDI
CommonInterface::main_window->Fullscreen();
#endif
InfoBoxManager::SetDirty();
ForceCalculation();
}
示例2: LocalPath
// TaskLoad
// Loads the task of the specified filename
void
InputEvents::eventTaskLoad(const TCHAR *misc)
{
if (protected_task_manager == NULL)
return;
if (!StringIsEmpty(misc)) {
TCHAR buffer[MAX_PATH];
LocalPath(buffer, misc);
OrderedTask *task = TaskFile::GetTask(buffer,
CommonInterface::GetComputerSettings().task,
&way_points, 0);
if (task) {
{
ScopeSuspendAllThreads suspend;
task->CheckDuplicateWaypoints(way_points);
way_points.Optimise();
}
task->FillMatPoints(way_points);
protected_task_manager->TaskCommit(*task);
delete task;
}
}
trigger_redraw();
}
示例3: StartupLogFreeRamAndStorage
static void
AfterStartup()
{
StartupLogFreeRamAndStorage();
#ifdef USE_LUA
{
Error error;
const auto lua_path = LocalPath(_T("lua"));
if (!Lua::StartFile(AllocatedPath::Build(lua_path, _T("init.lua")), error))
LogError(error);
}
#endif
if (is_simulator()) {
InputEvents::processGlideComputer(GCE_STARTUP_SIMULATOR);
} else {
InputEvents::processGlideComputer(GCE_STARTUP_REAL);
}
OrderedTask *defaultTask = LoadDefaultTask(CommonInterface::GetComputerSettings().task,
&way_points);
if (defaultTask) {
{
ScopeSuspendAllThreads suspend;
defaultTask->CheckDuplicateWaypoints(way_points);
way_points.Optimise();
}
protected_task_manager->TaskCommit(*defaultTask);
delete defaultTask;
}
task_manager->Resume();
InfoBoxManager::SetDirty();
ForceCalculation();
}
示例4: LogStartUp
void
XCSoarInterface::AfterStartup()
{
LogStartUp(_T("ProgramStarted = 3"));
StartupLogFreeRamAndStorage();
status_messages.Startup(true);
if (is_simulator()) {
LogStartUp(_T("GCE_STARTUP_SIMULATOR"));
InputEvents::processGlideComputer(GCE_STARTUP_SIMULATOR);
} else {
LogStartUp(_T("GCE_STARTUP_REAL"));
InputEvents::processGlideComputer(GCE_STARTUP_REAL);
}
OrderedTask *defaultTask = protected_task_manager->TaskCreateDefault(
&way_points, GetComputerSettings().task.task_type_default);
if (defaultTask) {
{
ScopeSuspendAllThreads suspend;
defaultTask->CheckDuplicateWaypoints(way_points);
way_points.Optimise();
}
protected_task_manager->TaskCommit(*defaultTask);
delete defaultTask;
}
task_manager->Resume();
main_window.Fullscreen();
InfoBoxManager::SetDirty();
TriggerGPSUpdate();
status_messages.Startup(false);
}
示例5: StartupLogFreeRamAndStorage
static void
AfterStartup()
{
StartupLogFreeRamAndStorage();
CommonInterface::status_messages.Startup(true);
if (is_simulator()) {
InputEvents::processGlideComputer(GCE_STARTUP_SIMULATOR);
} else {
InputEvents::processGlideComputer(GCE_STARTUP_REAL);
}
const TaskFactoryType task_type_default =
CommonInterface::GetComputerSettings().task.task_type_default;
OrderedTask *defaultTask =
protected_task_manager->TaskCreateDefault(&way_points, task_type_default);
if (defaultTask) {
{
ScopeSuspendAllThreads suspend;
defaultTask->CheckDuplicateWaypoints(way_points);
way_points.Optimise();
}
protected_task_manager->TaskCommit(*defaultTask);
delete defaultTask;
}
task_manager->Resume();
CommonInterface::main_window->Fullscreen();
InfoBoxManager::SetDirty();
ForceCalculation();
CommonInterface::status_messages.Startup(false);
}
示例6: lease
static void
SettingsLeave(const UISettings &old_ui_settings)
{
if (!globalRunningEvent.Test())
return;
SuspendAllThreads();
VerboseOperationEnvironment operation;
MainWindow &main_window = XCSoarInterface::main_window;
if (LanguageChanged)
ReadLanguageFile();
if (MapFileChanged) {
/* set these flags, because they may be loaded from the map
file */
AirspaceFileChanged = true;
AirfieldFileChanged = true;
WaypointFileChanged = true;
TerrainFileChanged = true;
TopographyFileChanged = true;
}
if (TerrainFileChanged) {
operation.SetText(_("Loading Terrain File..."));
main_window.SetTerrain(NULL);
glide_computer->SetTerrain(NULL);
// re-load terrain
delete terrain;
terrain = RasterTerrain::OpenTerrain(file_cache, operation);
main_window.SetTerrain(terrain);
glide_computer->SetTerrain(terrain);
}
if (WaypointFileChanged || AirfieldFileChanged) {
// re-load waypoints
WaypointGlue::LoadWaypoints(way_points, terrain, operation);
WaypointDetails::ReadFileFromProfile(way_points, operation);
}
if (WaypointFileChanged && protected_task_manager != NULL) {
ProtectedTaskManager::ExclusiveLease lease(*protected_task_manager);
OrderedTask *task = lease->Clone(XCSoarInterface::GetComputerSettings().task);
if (task) {
// this must be done in thread lock because it potentially changes the
// waypoints database
task->CheckDuplicateWaypoints(way_points);
/* XXX shall this task be committed if it has been modified? */
delete task;
way_points.Optimise();
}
}
if (WaypointFileChanged || TerrainFileChanged) {
// re-set home
WaypointGlue::SetHome(way_points, terrain,
XCSoarInterface::SetComputerSettings(),
device_blackboard, WaypointFileChanged);
WaypointGlue::SaveHome(CommonInterface::GetComputerSettings());
}
if (TopographyFileChanged) {
main_window.SetTopography(NULL);
topography->Reset();
LoadConfiguredTopography(*topography, operation);
main_window.SetTopography(topography);
}
if (AirspaceFileChanged) {
if (glide_computer != NULL)
glide_computer->GetAirspaceWarnings().clear();
if (glide_computer != NULL)
glide_computer->ClearAirspaces();
airspace_database.clear();
ReadAirspace(airspace_database, terrain,
CommonInterface::GetComputerSettings().pressure,
operation);
}
if (DevicePortChanged)
devRestart();
const UISettings &ui_settings = CommonInterface::GetUISettings();
Units::SetConfig(ui_settings.units);
const MapSettings &old_settings_map = old_ui_settings.map;
const MapSettings &settings_map = ui_settings.map;
if (settings_map.snail_type != old_settings_map.snail_type ||
settings_map.snail_scaling_enabled != old_settings_map.snail_scaling_enabled)
//.........这里部分代码省略.........
示例7: lease
static void
SettingsLeave(const UISettings &old_ui_settings)
{
if (!global_running)
return;
SuspendAllThreads();
VerboseOperationEnvironment operation;
MainWindow &main_window = *CommonInterface::main_window;
if (LanguageChanged)
ReadLanguageFile();
bool TerrainFileChanged = false, TopographyFileChanged = false;
if (MapFileChanged) {
/* set these flags, because they may be loaded from the map
file */
AirspaceFileChanged = true;
AirfieldFileChanged = true;
WaypointFileChanged = true;
TerrainFileChanged = true;
TopographyFileChanged = true;
}
if (TerrainFileChanged) {
operation.SetText(_("Loading Terrain File..."));
/* just in case the bottom widget uses the old terrain object
(e.g. the cross section) */
main_window.SetBottomWidget(nullptr);
main_window.SetTerrain(NULL);
glide_computer->SetTerrain(NULL);
// re-load terrain
delete terrain;
terrain = RasterTerrain::OpenTerrain(file_cache, operation);
main_window.SetTerrain(terrain);
glide_computer->SetTerrain(terrain);
/* re-create the bottom widget if it was deleted here */
PageActions::Update();
}
if (WaypointFileChanged || AirfieldFileChanged) {
// re-load waypoints
WaypointGlue::LoadWaypoints(way_points, terrain, operation);
WaypointDetails::ReadFileFromProfile(way_points, operation);
}
if (WaypointFileChanged && protected_task_manager != NULL) {
ProtectedTaskManager::ExclusiveLease lease(*protected_task_manager);
OrderedTask *task = lease->Clone(CommonInterface::GetComputerSettings().task);
if (task) {
// this must be done in thread lock because it potentially changes the
// waypoints database
task->CheckDuplicateWaypoints(way_points);
/* XXX shall this task be committed if it has been modified? */
delete task;
way_points.Optimise();
}
}
if (WaypointFileChanged || TerrainFileChanged) {
// re-set home
WaypointGlue::SetHome(way_points, terrain,
CommonInterface::SetComputerSettings().poi,
CommonInterface::SetComputerSettings().team_code,
device_blackboard, WaypointFileChanged);
WaypointGlue::SaveHome(Profile::map,
CommonInterface::GetComputerSettings().poi,
CommonInterface::GetComputerSettings().team_code);
}
if (TopographyFileChanged) {
main_window.SetTopography(NULL);
topography->Reset();
LoadConfiguredTopography(*topography, operation);
main_window.SetTopography(topography);
}
if (AirspaceFileChanged) {
if (glide_computer != NULL)
glide_computer->GetAirspaceWarnings().Clear();
if (glide_computer != NULL)
glide_computer->ClearAirspaces();
airspace_database.Clear();
ReadAirspace(airspace_database, terrain,
CommonInterface::GetComputerSettings().pressure,
operation);
}
if (DevicePortChanged)
//.........这里部分代码省略.........