From fb26baa67613d81fb478979c878d428f9ad8d3f5 Mon Sep 17 00:00:00 2001 From: "Maria-PC\\School" Date: Mon, 31 Aug 2026 10:42:10 -0400 Subject: [PATCH 1/3] Updating data_logging information when scene is unloaded (not just when it is loaded) --- src/main.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.gd b/src/main.gd index d059d8a..88233ff 100644 --- a/src/main.gd +++ b/src/main.gd @@ -39,6 +39,8 @@ func load_scene(path: String): func unload_scene(): if _current_scene_node: _current_scene_node.queue_free() + if (Config.get_value("devices.data_logging.enabled")) == true: + SignalBus.session_scene.emit("") func _current_scene(_connection): From 6f030ef5472d4bbf80545ae84cb6406bb203ab8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laboratoire=20de=20recherche=20en=20mobilit=C3=A9=20et=20s?= =?UTF-8?q?yst=C3=A8mes=20adapt=C3=A9s?= Date: Mon, 31 Aug 2026 11:21:20 -0400 Subject: [PATCH 2/3] Edits so that a new trial is never created on an empty scene --- src/devices/data_logging/data_logging.gd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/devices/data_logging/data_logging.gd b/src/devices/data_logging/data_logging.gd index 8485cde..125648f 100644 --- a/src/devices/data_logging/data_logging.gd +++ b/src/devices/data_logging/data_logging.gd @@ -21,7 +21,7 @@ var connection_command = NAN # called everytime a signal is received from main.gd to save it func _scene_signal_received(scene_name): scenes["new"] = scene_name.get_file().split(".")[0].replace("_", "") - # When logging in on, initiate a new file (trial) and update current scene if new + # When logging in on, update current scene if new if scenes["current"] != scenes["new"]: # If a trial was in progress (i.e. previous scene is not blank), end it if scenes["current"] != "": @@ -29,10 +29,12 @@ func _scene_signal_received(scene_name): Globals.main.get_node("PythonBridge").send("end_trial", data, "once") player_trajectory["position"] = NAN player_trajectory["rotation"] = NAN - + scenes["current"] = scenes["new"] update_data() - if logging["current"] == true and Globals.main.has_node("PythonBridge"): + + # If new trial is not empty, create one + if logging["current"] == true and scene_name != "" and Globals.main.has_node("PythonBridge"): Globals.main.get_node("PythonBridge").send("create_trial", data, "once") From cac2c72505f553f5b83af6a1f705d7ba7262ba0a Mon Sep 17 00:00:00 2001 From: "Maria-PC\\School" Date: Mon, 31 Aug 2026 12:01:01 -0400 Subject: [PATCH 3/3] Ran check_code_quality.py --- src/devices/data_logging/data_logging.gd | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/devices/data_logging/data_logging.gd b/src/devices/data_logging/data_logging.gd index 125648f..c451bb6 100644 --- a/src/devices/data_logging/data_logging.gd +++ b/src/devices/data_logging/data_logging.gd @@ -29,12 +29,16 @@ func _scene_signal_received(scene_name): Globals.main.get_node("PythonBridge").send("end_trial", data, "once") player_trajectory["position"] = NAN player_trajectory["rotation"] = NAN - + scenes["current"] = scenes["new"] update_data() - + # If new trial is not empty, create one - if logging["current"] == true and scene_name != "" and Globals.main.has_node("PythonBridge"): + if ( + logging["current"] == true + and scene_name != "" + and Globals.main.has_node("PythonBridge") + ): Globals.main.get_node("PythonBridge").send("create_trial", data, "once")