4 #include "Developer/Settings/Public/ISettingsModule.h" 5 #include "Developer/Settings/Public/ISettingsSection.h" 6 #include "Developer/Settings/Public/ISettingsContainer.h" 9 #define LOCTEXT_NAMESPACE "FCarlaModule" 22 #if defined(WITH_CHRONO) && PLATFORM_WINDOWS 23 const FString BaseDir = FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT(
"Carla"));
24 const FString DllDir = FPaths::Combine(*BaseDir, TEXT(
"CarlaDependencies"), TEXT(
"dll"));
25 FString ChronoEngineDll = FPaths::Combine(*DllDir, TEXT(
"ChronoEngine.dll"));
26 FString ChronoVehicleDll = FPaths::Combine(*DllDir, TEXT(
"ChronoEngine_vehicle.dll"));
27 FString ChronoModelsDll = FPaths::Combine(*DllDir, TEXT(
"ChronoModels_vehicle.dll"));
28 FString ChronoRobotDll = FPaths::Combine(*DllDir, TEXT(
"ChronoModels_robot.dll"));
29 UE_LOG(LogCarla, Log, TEXT(
"Loading Dlls from: %s"), *DllDir);
30 auto ChronoEngineHandle = FPlatformProcess::GetDllHandle(*ChronoEngineDll);
31 if (!ChronoEngineHandle)
33 UE_LOG(LogCarla, Warning, TEXT(
"Error: ChronoEngine.dll could not be loaded"));
35 auto ChronoVehicleHandle = FPlatformProcess::GetDllHandle(*ChronoVehicleDll);
36 if (!ChronoVehicleHandle)
38 UE_LOG(LogCarla, Warning, TEXT(
"Error: ChronoEngine_vehicle.dll could not be loaded"));
40 auto ChronoModelsHandle = FPlatformProcess::GetDllHandle(*ChronoModelsDll);
41 if (!ChronoModelsHandle)
43 UE_LOG(LogCarla, Warning, TEXT(
"Error: ChronoModels_vehicle.dll could not be loaded"));
45 auto ChronoRobotHandle = FPlatformProcess::GetDllHandle(*ChronoRobotDll);
46 if (!ChronoRobotHandle)
48 UE_LOG(LogCarla, Warning, TEXT(
"Error: ChronoModels_robot.dll could not be loaded"));
55 if (UObjectInitialized())
67 if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>(
"Settings"))
70 ISettingsContainerPtr SettingsContainer = SettingsModule->GetContainer(
"Project");
72 SettingsContainer->DescribeCategory(
"CARLASettings",
73 LOCTEXT(
"RuntimeWDCategoryName",
"CARLA Settings"),
74 LOCTEXT(
"RuntimeWDCategoryDescription",
"CARLA plugin settings"));
77 ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings(
"Project",
"CARLASettings",
"General",
78 LOCTEXT(
"RuntimeGeneralSettingsName",
"General"),
79 LOCTEXT(
"RuntimeGeneralSettingsDescription",
"General configuration for the CARLA plugin"),
80 GetMutableDefault<UCarlaSettings>()
85 if (SettingsSection.IsValid())
97 if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>(
"Settings"))
99 SettingsModule->UnregisterSettings(
"Project",
"CustomSettings",
"General");
106 bool ResaveSettings =
false;
113 Settings->SaveConfig();
119 #undef LOCTEXT_NAMESPACE 127 #include <compiler/disable-ue4-macros.h> 136 UE_LOG(LogCarla, Fatal, TEXT(
"Exception thrown: %s"), UTF8_TO_TCHAR(e.what()));
void UnregisterSettings()
void throw_exception(const std::exception &e)
virtual void StartupModule() override
IModuleInterface implementation.
This file contains definitions of common data structures used in traffic manager. ...
bool HandleSettingsSaved()
Global settings for CARLA.
virtual void ShutdownModule() override
DEFINE_LOG_CATEGORY(LogCarla)