diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 2f6535e121da317be69d3b9a510a5fea739b0de9..cf85dde35bdc45c8d32b77ce7b31501463681f53 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -152,7 +152,9 @@ GameDefaultMap = /Game/VRTemplate/Maps/VRTemplateMap.VRTemplateMap ServerDefaultMap = /Engine/Maps/Entry.Entry GlobalDefaultGameMode = /Game/VRTemplate/Blueprints/VRGameMode.VRGameMode_C GlobalDefaultServerGameMode = None -GameInstanceClass=/Script/MetaCastBachelor.StudyManager +GameInstanceClass=/Game/BP/BP_StudyManager.BP_StudyManager_C +EditorStartupMap=/Game/Maps/Login.Login +GameDefaultMap=/Game/Maps/Login.Login [/Script/Slate.SlateSettings] bExplicitCanvasChildZOrder = True diff --git a/Content/BP/BP_StudyManager.uasset b/Content/BP/BP_StudyManager.uasset new file mode 100644 index 0000000000000000000000000000000000000000..a07f987d1db03273f19c8f57160b3f2eb70784d5 Binary files /dev/null and b/Content/BP/BP_StudyManager.uasset differ diff --git a/Content/Data/data/Flocculentcube1 b/Content/Data/data/Flocculentcube1 new file mode 100644 index 0000000000000000000000000000000000000000..719740a29b8579401d5f2d6d06c699be1f675a70 Binary files /dev/null and b/Content/Data/data/Flocculentcube1 differ diff --git a/Content/Data/data/Flocculentcube2 b/Content/Data/data/Flocculentcube2 new file mode 100644 index 0000000000000000000000000000000000000000..1747dfc626e6c50eec95f6bc407eec9919b445d1 Binary files /dev/null and b/Content/Data/data/Flocculentcube2 differ diff --git a/Content/Data/data/Flocculentcube3 b/Content/Data/data/Flocculentcube3 new file mode 100644 index 0000000000000000000000000000000000000000..813f641872ccea219eab00b1a3ed336633402c83 Binary files /dev/null and b/Content/Data/data/Flocculentcube3 differ diff --git a/Content/Data/data/ball_hemisphere b/Content/Data/data/ball_hemisphere new file mode 100644 index 0000000000000000000000000000000000000000..dddbf6f16413f23817cafb4bd7e743f3ef65d97b Binary files /dev/null and b/Content/Data/data/ball_hemisphere differ diff --git a/Content/Data/data/disk b/Content/Data/data/disk new file mode 100644 index 0000000000000000000000000000000000000000..17215632170fe7f0f2be2f0661adc548490af94f Binary files /dev/null and b/Content/Data/data/disk differ diff --git a/Content/Data/data/fiveellipsolds b/Content/Data/data/fiveellipsolds new file mode 100644 index 0000000000000000000000000000000000000000..f0a518a4d0529dd3e8257772adae4f5004c57d82 Binary files /dev/null and b/Content/Data/data/fiveellipsolds differ diff --git a/Content/Data/data/galaxy b/Content/Data/data/galaxy new file mode 100644 index 0000000000000000000000000000000000000000..2293adc99ac10f3240672eeada206133c27b9dc8 Binary files /dev/null and b/Content/Data/data/galaxy differ diff --git a/Content/Data/data/multiEllipsolds b/Content/Data/data/multiEllipsolds new file mode 100644 index 0000000000000000000000000000000000000000..38f19defbd9054302194301bc995792ab1f80dde Binary files /dev/null and b/Content/Data/data/multiEllipsolds differ diff --git a/Content/Data/data/nbody1 b/Content/Data/data/nbody1 new file mode 100644 index 0000000000000000000000000000000000000000..aac76e9ebbcd4ea5ee04774e362b13f826ae5b11 Binary files /dev/null and b/Content/Data/data/nbody1 differ diff --git a/Content/Data/data/nbody2 b/Content/Data/data/nbody2 new file mode 100644 index 0000000000000000000000000000000000000000..2e4f0d4043973ef7a85e486b6fa645134343df2f Binary files /dev/null and b/Content/Data/data/nbody2 differ diff --git a/Content/Data/data/snap_animation b/Content/Data/data/snap_animation new file mode 100644 index 0000000000000000000000000000000000000000..c0435e63400f67f03c504f33ef1aa54216a9ab9b Binary files /dev/null and b/Content/Data/data/snap_animation differ diff --git a/Content/Data/data/stringf b/Content/Data/data/stringf new file mode 100644 index 0000000000000000000000000000000000000000..254be663e258c5fc772b476eecbcf4c0aa2b1d74 Binary files /dev/null and b/Content/Data/data/stringf differ diff --git a/Content/Data/data/stringf1 b/Content/Data/data/stringf1 new file mode 100644 index 0000000000000000000000000000000000000000..862adc31c89abe00d89b8be053967d08497ce372 Binary files /dev/null and b/Content/Data/data/stringf1 differ diff --git a/Content/Data/data/strings b/Content/Data/data/strings new file mode 100644 index 0000000000000000000000000000000000000000..3a619fb895319db8df397cb2d5447b4a8024ffd1 Binary files /dev/null and b/Content/Data/data/strings differ diff --git a/Content/Data/data/three_rings b/Content/Data/data/three_rings new file mode 100644 index 0000000000000000000000000000000000000000..0c305df407c8dc77bd41692595784488e05bcab1 Binary files /dev/null and b/Content/Data/data/three_rings differ diff --git a/Content/Data/data/training_cylinder b/Content/Data/data/training_cylinder new file mode 100644 index 0000000000000000000000000000000000000000..8b3d37cb62acbadf5744c9700e1e0b6875b72d12 Binary files /dev/null and b/Content/Data/data/training_cylinder differ diff --git a/Content/Data/data/training_cylinder_2 b/Content/Data/data/training_cylinder_2 new file mode 100644 index 0000000000000000000000000000000000000000..8b3d37cb62acbadf5744c9700e1e0b6875b72d12 Binary files /dev/null and b/Content/Data/data/training_cylinder_2 differ diff --git a/Content/Data/data/training_pyramid b/Content/Data/data/training_pyramid new file mode 100644 index 0000000000000000000000000000000000000000..c0e280e042fd8e735dfeeb1aa44180e78d76e4c1 Binary files /dev/null and b/Content/Data/data/training_pyramid differ diff --git a/Content/Data/data/training_pyramid_2 b/Content/Data/data/training_pyramid_2 new file mode 100644 index 0000000000000000000000000000000000000000..c0e280e042fd8e735dfeeb1aa44180e78d76e4c1 Binary files /dev/null and b/Content/Data/data/training_pyramid_2 differ diff --git a/Content/Data/data/training_sphere b/Content/Data/data/training_sphere new file mode 100644 index 0000000000000000000000000000000000000000..40549f59555077bdbc59481d6c7e2f0fd219b1ff Binary files /dev/null and b/Content/Data/data/training_sphere differ diff --git a/Content/Data/data/training_sphere_2 b/Content/Data/data/training_sphere_2 new file mode 100644 index 0000000000000000000000000000000000000000..40549f59555077bdbc59481d6c7e2f0fd219b1ff Binary files /dev/null and b/Content/Data/data/training_sphere_2 differ diff --git a/Content/Data/data/training_torus b/Content/Data/data/training_torus new file mode 100644 index 0000000000000000000000000000000000000000..84e4b176d0c4af564d7680357c8e2f5014e48e4d Binary files /dev/null and b/Content/Data/data/training_torus differ diff --git a/Content/Data/data/uniform_Lines b/Content/Data/data/uniform_Lines new file mode 100644 index 0000000000000000000000000000000000000000..df5b5c9fe85f5c87032c5c5fb932614953e084d7 Binary files /dev/null and b/Content/Data/data/uniform_Lines differ diff --git a/Content/Data/data/ununiform_Lines b/Content/Data/data/ununiform_Lines new file mode 100644 index 0000000000000000000000000000000000000000..ebc6fd539fb2d350306a45c05f9b502777426fe5 Binary files /dev/null and b/Content/Data/data/ununiform_Lines differ diff --git a/Content/Data/flags/Flocculentcube1_flags_1 b/Content/Data/flags/Flocculentcube1_flags_1 new file mode 100644 index 0000000000000000000000000000000000000000..8af45816dcfb059ea97292a1cb27dfe2a21cb6e7 Binary files /dev/null and b/Content/Data/flags/Flocculentcube1_flags_1 differ diff --git a/Content/Data/flags/Flocculentcube1_flags_2 b/Content/Data/flags/Flocculentcube1_flags_2 new file mode 100644 index 0000000000000000000000000000000000000000..c6277c42eb1828369e8e54d3f49cd93e3554ca64 Binary files /dev/null and b/Content/Data/flags/Flocculentcube1_flags_2 differ diff --git a/Content/Data/flags/Flocculentcube1_flags_3 b/Content/Data/flags/Flocculentcube1_flags_3 new file mode 100644 index 0000000000000000000000000000000000000000..22e320f6348437fd2f29b84792dec60dd3cf69a2 Binary files /dev/null and b/Content/Data/flags/Flocculentcube1_flags_3 differ diff --git a/Content/Data/flags/Flocculentcube1_prestudy_flags b/Content/Data/flags/Flocculentcube1_prestudy_flags new file mode 100644 index 0000000000000000000000000000000000000000..0ce38c1de28e3466e4fd0ec39ed8f5efe6875456 Binary files /dev/null and b/Content/Data/flags/Flocculentcube1_prestudy_flags differ diff --git a/Content/Data/flags/Flocculentcube2_flags b/Content/Data/flags/Flocculentcube2_flags new file mode 100644 index 0000000000000000000000000000000000000000..9cc0f93309d9842c6356ab5767c9afcfc8b09070 Binary files /dev/null and b/Content/Data/flags/Flocculentcube2_flags differ diff --git a/Content/Data/flags/Flocculentcube3_flags b/Content/Data/flags/Flocculentcube3_flags new file mode 100644 index 0000000000000000000000000000000000000000..caf9663e065431833ffd13bdeef37dbc23635890 Binary files /dev/null and b/Content/Data/flags/Flocculentcube3_flags differ diff --git a/Content/Data/flags/ball_hemisphere_flags b/Content/Data/flags/ball_hemisphere_flags new file mode 100644 index 0000000000000000000000000000000000000000..2ffd68f8c621cfd08bc6eae6ec0bcc0ae52cc8cd Binary files /dev/null and b/Content/Data/flags/ball_hemisphere_flags differ diff --git a/Content/Data/flags/disk_flags b/Content/Data/flags/disk_flags new file mode 100644 index 0000000000000000000000000000000000000000..e5b450fcb846f104e5d0d927b4cc9383597ee3ab Binary files /dev/null and b/Content/Data/flags/disk_flags differ diff --git a/Content/Data/flags/fivecluster_prestudy_flags b/Content/Data/flags/fivecluster_prestudy_flags new file mode 100644 index 0000000000000000000000000000000000000000..5df2a61fff79ba97b8b16233255f23f8f39a5e23 Binary files /dev/null and b/Content/Data/flags/fivecluster_prestudy_flags differ diff --git a/Content/Data/flags/fiveellipsolds_flags_1 b/Content/Data/flags/fiveellipsolds_flags_1 new file mode 100644 index 0000000000000000000000000000000000000000..80b7eb1a6305e706d1ee329f739ce6703a54dadb Binary files /dev/null and b/Content/Data/flags/fiveellipsolds_flags_1 differ diff --git a/Content/Data/flags/fiveellipsolds_flags_2 b/Content/Data/flags/fiveellipsolds_flags_2 new file mode 100644 index 0000000000000000000000000000000000000000..45bf7c96c8ed94e68440e21fdb552f327f8fa17c Binary files /dev/null and b/Content/Data/flags/fiveellipsolds_flags_2 differ diff --git a/Content/Data/flags/halfrings_flags b/Content/Data/flags/halfrings_flags new file mode 100644 index 0000000000000000000000000000000000000000..4f61d649f98f053892b4a01863e2f7145a1244e6 Binary files /dev/null and b/Content/Data/flags/halfrings_flags differ diff --git a/Content/Data/flags/nbody1_flags b/Content/Data/flags/nbody1_flags new file mode 100644 index 0000000000000000000000000000000000000000..3cc2e9c901675b42206d1413e308cb2cacf750e0 Binary files /dev/null and b/Content/Data/flags/nbody1_flags differ diff --git a/Content/Data/flags/nbody2_flags b/Content/Data/flags/nbody2_flags new file mode 100644 index 0000000000000000000000000000000000000000..3f31ed7c397b618b0c6365e47767442bbd7ba563 Binary files /dev/null and b/Content/Data/flags/nbody2_flags differ diff --git a/Content/Data/flags/nbody_prestudy_flags b/Content/Data/flags/nbody_prestudy_flags new file mode 100644 index 0000000000000000000000000000000000000000..70f93aebd5959064941c2a646d19b7f26211774d Binary files /dev/null and b/Content/Data/flags/nbody_prestudy_flags differ diff --git a/Content/Data/flags/new_plus_flags b/Content/Data/flags/new_plus_flags new file mode 100644 index 0000000000000000000000000000000000000000..154f5f62b2309531e05d563dc7e94521c7c98914 Binary files /dev/null and b/Content/Data/flags/new_plus_flags differ diff --git a/Content/Data/flags/shell_prestudy_flags b/Content/Data/flags/shell_prestudy_flags new file mode 100644 index 0000000000000000000000000000000000000000..e547980bf16ff902fd76e5d9252ea5f6318be214 Binary files /dev/null and b/Content/Data/flags/shell_prestudy_flags differ diff --git a/Content/Data/flags/snap_animation_flags b/Content/Data/flags/snap_animation_flags new file mode 100644 index 0000000000000000000000000000000000000000..f0c478de4d0489519ca66215cf6fb4ef56e8bb2f Binary files /dev/null and b/Content/Data/flags/snap_animation_flags differ diff --git a/Content/Data/flags/three_rings_flags b/Content/Data/flags/three_rings_flags new file mode 100644 index 0000000000000000000000000000000000000000..def44500afa203dcc2529aa27027891abb782329 Binary files /dev/null and b/Content/Data/flags/three_rings_flags differ diff --git a/Content/Data/flags/training_cylinder_flags b/Content/Data/flags/training_cylinder_flags new file mode 100644 index 0000000000000000000000000000000000000000..c7c1e7d15fb7bd8518a0e3b8e3031ea431f2c049 Binary files /dev/null and b/Content/Data/flags/training_cylinder_flags differ diff --git a/Content/Data/flags/training_pyramid_flags b/Content/Data/flags/training_pyramid_flags new file mode 100644 index 0000000000000000000000000000000000000000..57141fb4d1176e0974a4fb369bc263378a4683b6 Binary files /dev/null and b/Content/Data/flags/training_pyramid_flags differ diff --git a/Content/Data/flags/training_sphere_flags b/Content/Data/flags/training_sphere_flags new file mode 100644 index 0000000000000000000000000000000000000000..230120a6b894a6bd68f21666cd66c1a97825703b Binary files /dev/null and b/Content/Data/flags/training_sphere_flags differ diff --git a/Content/Data/flags/training_torus_flags b/Content/Data/flags/training_torus_flags new file mode 100644 index 0000000000000000000000000000000000000000..a2b41f7a5d882c01333da5e67513be51af6f02f6 Binary files /dev/null and b/Content/Data/flags/training_torus_flags differ diff --git a/Content/Data/flags/uniform_Lines_flags b/Content/Data/flags/uniform_Lines_flags new file mode 100644 index 0000000000000000000000000000000000000000..01bb40f62edb12a9fb2c09834c3b8cef1be6a368 Binary files /dev/null and b/Content/Data/flags/uniform_Lines_flags differ diff --git a/Content/Data/flags/ununiform_Lines_flags b/Content/Data/flags/ununiform_Lines_flags new file mode 100644 index 0000000000000000000000000000000000000000..9eb8910d32f9e802be5a01468bda030c25202543 Binary files /dev/null and b/Content/Data/flags/ununiform_Lines_flags differ diff --git a/Content/Maps/BaselineMap.umap b/Content/Maps/BaselineMap.umap index 9de67b74856c69c35a97b1dababa26e52d0aa983..12a2df715ed1de654bda7a10f473afad9a9dd408 100644 Binary files a/Content/Maps/BaselineMap.umap and b/Content/Maps/BaselineMap.umap differ diff --git a/Content/Maps/Login.umap b/Content/Maps/Login.umap index 4b1097f1320275d14975cc9b8dd7ff18a59ebc21..479d8b96867054bc46dc0d0eda4a2eef84b30eee 100644 Binary files a/Content/Maps/Login.umap and b/Content/Maps/Login.umap differ diff --git a/Content/Maps/MagicWandMap.umap b/Content/Maps/MagicWandMap.umap index c2c339c8e58021b6b782d5be6845ba6079ab1276..79306dbb9a7805ce4259668a73b56f586930a0f0 100644 Binary files a/Content/Maps/MagicWandMap.umap and b/Content/Maps/MagicWandMap.umap differ diff --git a/Content/Maps/MetaPointMap.umap b/Content/Maps/MetaPointMap.umap index a90854d788da949d4f535913152805a0d41f8462..669848a7912aa6d174b16d1e60a13f78324e3303 100644 Binary files a/Content/Maps/MetaPointMap.umap and b/Content/Maps/MetaPointMap.umap differ diff --git a/Content/UI/LoginIMC.uasset b/Content/UI/LoginIMC.uasset new file mode 100644 index 0000000000000000000000000000000000000000..df584c08e51d1a76eaa9aee172aeba6cb5a73545 Binary files /dev/null and b/Content/UI/LoginIMC.uasset differ diff --git a/Content/UI/LoginManager.uasset b/Content/UI/LoginManager.uasset index 3b8d5e42b82a1bbeaaa1f1bf8074e2da9f77a458..a5434726cafe58959fd6142bc9f83110340f7234 100644 Binary files a/Content/UI/LoginManager.uasset and b/Content/UI/LoginManager.uasset differ diff --git a/Content/UI/SaveIdAction.uasset b/Content/UI/SaveIdAction.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9e2500af43779b2041a51137d594852afa478929 Binary files /dev/null and b/Content/UI/SaveIdAction.uasset differ diff --git a/Content/UI/StudyLogin.uasset b/Content/UI/StudyLogin.uasset index 352dcfe5583b5870307ec88fa185f6e53e564c82..37e96ed50571d750579d2b20272d6d6afbc3aed9 100644 Binary files a/Content/UI/StudyLogin.uasset and b/Content/UI/StudyLogin.uasset differ diff --git a/Content/VRTemplate/Input/PMI_VRTemplate.uasset b/Content/VRTemplate/Input/PMI_VRTemplate.uasset index 31da50fd3bf168527569f731bde336a0e3f80838..e815d53fa115534338a0439bbe3aff2dd60361fd 100644 Binary files a/Content/VRTemplate/Input/PMI_VRTemplate.uasset and b/Content/VRTemplate/Input/PMI_VRTemplate.uasset differ diff --git a/ParticipantLogs/Participant_32/PlayInEditor_08-01-24_18-53-23/32_1722531215.log b/ParticipantLogs/Participant_32/PlayInEditor_08-01-24_18-53-23/32_1722531215.log new file mode 100644 index 0000000000000000000000000000000000000000..05e9bac09ad4ed9b956e36c57ddb0f207137d5d4 --- /dev/null +++ b/ParticipantLogs/Participant_32/PlayInEditor_08-01-24_18-53-23/32_1722531215.log @@ -0,0 +1 @@ +Initializing session for participant ID: 32 at Timestamp: 1722531215 \ No newline at end of file diff --git a/ParticipantLogs/Participant_32/PlayInEditor_08-01-24_18-54-31/32_1722531290.log b/ParticipantLogs/Participant_32/PlayInEditor_08-01-24_18-54-31/32_1722531290.log new file mode 100644 index 0000000000000000000000000000000000000000..ee6c8ea758de653342d3d0da9851f481357b5753 --- /dev/null +++ b/ParticipantLogs/Participant_32/PlayInEditor_08-01-24_18-54-31/32_1722531290.log @@ -0,0 +1 @@ +Initializing session for participant ID: 32 at Timestamp: 1722531290 \ No newline at end of file diff --git a/Plugins/UE4_GPUPointCloudRenderer.rar b/Plugins/UE4_GPUPointCloudRenderer.rar new file mode 100644 index 0000000000000000000000000000000000000000..d15b4143aec99f133115f367c3fb3235f841fe53 Binary files /dev/null and b/Plugins/UE4_GPUPointCloudRenderer.rar differ diff --git a/Plugins/universallogging b/Plugins/universallogging new file mode 160000 index 0000000000000000000000000000000000000000..a5dc8c43b44425eedcdbde56230e2d9181fc51e1 --- /dev/null +++ b/Plugins/universallogging @@ -0,0 +1 @@ +Subproject commit a5dc8c43b44425eedcdbde56230e2d9181fc51e1 diff --git a/Source/MetaCastBachelor/MetaCastBachelor.Build.cs b/Source/MetaCastBachelor/MetaCastBachelor.Build.cs index 26018c6cd8b8a9be0fbf29a9ff606fc2c9973a1b..d2e00742a7b47f4bccb02e3114b9ccb480fb90b7 100644 --- a/Source/MetaCastBachelor/MetaCastBachelor.Build.cs +++ b/Source/MetaCastBachelor/MetaCastBachelor.Build.cs @@ -10,7 +10,7 @@ public class MetaCastBachelor : ModuleRules PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ProceduralMeshComponent", "EnhancedInput"}); - PrivateDependencyModuleNames.AddRange(new string[] {"GPUPointCloudRenderer", "GPUPointCloudRendererEditor", "RWTHVRToolkit", "ProceduralMeshComponent", "Kdtree"}); + PrivateDependencyModuleNames.AddRange(new string[] {"GPUPointCloudRenderer", "GPUPointCloudRendererEditor", "RWTHVRToolkit", "ProceduralMeshComponent", "Kdtree", "UniversalLogging"}); // Uncomment if you are using Slate UI // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); diff --git a/Source/MetaCastBachelor/PointStorage/PointCloud.cpp b/Source/MetaCastBachelor/PointStorage/PointCloud.cpp index cbe28c55d1fc6d51cc82a58b8fedd3f769702efb..afa6bdd137b3a4bab7c89e503e56ab6a76a3c291 100644 --- a/Source/MetaCastBachelor/PointStorage/PointCloud.cpp +++ b/Source/MetaCastBachelor/PointStorage/PointCloud.cpp @@ -18,8 +18,14 @@ void APointCloud::BeginPlay() CurrentPointCloudIndex = 0; CurrentPointCloudFlagIndex = 0; - - InitPointCloudAndFlagFiles(PointInputFolder, FlagInputFolder); + + const FString SPointCloudFolder = FPaths::Combine(FPaths::ProjectContentDir(), PointInputFolder); + const FString SPointFlagFolder = FPaths::Combine(FPaths::ProjectContentDir(), FlagInputFolder); + + UE_LOG(LogTemp, Log, TEXT("Point Cloud Folder: %s"), *SPointCloudFolder); + UE_LOG(LogTemp, Log, TEXT("Flag Folder: %s"), *SPointFlagFolder); + + InitPointCloudAndFlagFiles(FFilePath(SPointCloudFolder), FFilePath(SPointFlagFolder)); ResetPointCloudData(); diff --git a/Source/MetaCastBachelor/PointStorage/PointCloud.h b/Source/MetaCastBachelor/PointStorage/PointCloud.h index 672a0b41a907aada54a7645c0b8b39b46ade99a0..4bfa3e9add063100cbb4889bf21d7e1fcb9333fc 100644 --- a/Source/MetaCastBachelor/PointStorage/PointCloud.h +++ b/Source/MetaCastBachelor/PointStorage/PointCloud.h @@ -52,10 +52,10 @@ public: float SplatSize = 1.0f; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Files") - FFilePath PointInputFolder; + FString PointInputFolder; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Files") - FFilePath FlagInputFolder; + FString FlagInputFolder; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Materials") UMaterialInterface* SelectedMaterial; diff --git a/Source/MetaCastBachelor/StudyManager.cpp b/Source/MetaCastBachelor/StudyManager.cpp index a97ed4be2fd33f8aef6decbea614573b0902a10b..2b4f4e867aafd6c61080f2dda2582052289e49a3 100644 --- a/Source/MetaCastBachelor/StudyManager.cpp +++ b/Source/MetaCastBachelor/StudyManager.cpp @@ -1,19 +1,70 @@ #include "StudyManager.h" +#include "Kismet/GameplayStatics.h" + void UStudyManager::InitializeParticipant(const int32 ParticipantID) { CurrentParticipantID = ParticipantID; + + // Generate a log stream name based on the participant ID + const FString StreamName = FString::Printf(TEXT("Participant_%d"), ParticipantID); + + // Generate a folder name for each participant based on their ID + const FString FolderName = FString::Printf(TEXT("ParticipantLogs/Participant_%d"), ParticipantID); + + // Get the current Unix timestamp + int64 Timestamp = FDateTime::UtcNow().ToUnixTimestamp(); + const FString Filename = FString::Printf(TEXT("%d_%lld.log"), ParticipantID, Timestamp); + + // Create a new log stream for this participant with a new folder and timestamped filename + ILogStream* ParticipantLogStream = UniLog.NewLogStream(StreamName, FolderName, Filename, true); + + if (ParticipantLogStream && ParticipantLogStream->GetIsValid()) + { + // Log the initialization message + UniLog.LogF(StreamName, TEXT("Initializing session for participant ID: %d at Timestamp: %lld"), ParticipantID, Timestamp); + } + else + { + // If stream creation failed, log this to the default log + UE_LOG(LogTemp, Error, TEXT("Failed to create log stream for participant %d"), ParticipantID); + } + + UE_LOG(LogTemp, Log, TEXT("Initialized Participant ID: %d"), ParticipantID); + +} + +void UStudyManager::SetNewStateAndLoadMap(const EStudyState NewState) +{ + CurrentState = NewState; - StudyOrder = LatinSquare.GetOrder(ParticipantID); - StudyOrder.Insert(EStudyState::Tutorial, 0); // Insert Tutorial at the beginning - StudyOrder.Add(EStudyState::Final); // Append Final at the end - - CurrentState = StudyOrder[0]; // Start with Tutorial + FString MapToLoad; + switch (CurrentState) + { + case EStudyState::Brush: + MapToLoad = MapForBrush; + break; + case EStudyState::MagicWand: + MapToLoad = MapForMagicWand; + break; + case EStudyState::MetaPoint: + MapToLoad = MapForMetaPoint; + break; + default: + UE_LOG(LogTemp, Warning, TEXT("StudyManager: No map associated with the current state.")); + return; + } - // Log initial setup for debugging - UE_LOG(LogTemp, Warning, TEXT("Study initialized for participant ID: %d"), CurrentParticipantID); - for (EStudyState State : StudyOrder) + if (!MapToLoad.IsEmpty()) { - UE_LOG(LogTemp, Log, TEXT("Order: %d"), (int32)State); + UE_LOG(LogTemp, Log, TEXT("Loading level: %s"), *MapToLoad); + UGameplayStatics::OpenLevel(this, FName(*MapToLoad)); + } + else + { + UE_LOG(LogTemp, Error, TEXT("StudyManager: The map to load is not set or is empty.")); } } + +EStudyState UStudyManager::GetCurrentState() const +{ return CurrentState; } diff --git a/Source/MetaCastBachelor/StudyManager.h b/Source/MetaCastBachelor/StudyManager.h index 7cb7fad8e2bb5153c3d359999c6f7608fda0f4d8..26653e09f277271ef42822b0de33bbd0a586215f 100644 --- a/Source/MetaCastBachelor/StudyManager.h +++ b/Source/MetaCastBachelor/StudyManager.h @@ -2,6 +2,7 @@ #include "CoreMinimal.h" #include "Engine/GameInstance.h" +#include "IUniversalLogging.h" #include "StudyManager.generated.h" UENUM(BlueprintType) @@ -59,13 +60,27 @@ class UStudyManager : public UGameInstance GENERATED_BODY() public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Study Maps") + FString MapForBrush; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Study Maps") + FString MapForMagicWand; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Study Maps") + FString MapForMetaPoint; + UFUNCTION(BlueprintCallable) void InitializeParticipant(int32 ParticipantID); + UFUNCTION(BlueprintCallable) + void SetNewStateAndLoadMap(EStudyState NewState); + + UFUNCTION(BlueprintCallable) + EStudyState GetCurrentState() const; + private: int32 CurrentParticipantID; TArray<EStudyState> StudyOrder; EStudyState CurrentState; - FLatinSquare LatinSquare; };