diff options
author | Théo de la Hogue | 2022-11-09 16:55:53 +0100 |
---|---|---|
committer | Théo de la Hogue | 2022-11-09 16:55:53 +0100 |
commit | aefefb657421d66ea66347f14ca0409a0c55ec54 (patch) | |
tree | ce61f2fdde677b5f693b11fdef869a59773d0c23 | |
parent | 04b3d6ba2a1bcdfee8f75965ccd3f03eb229533f (diff) | |
download | argaze-aefefb657421d66ea66347f14ca0409a0c55ec54.zip argaze-aefefb657421d66ea66347f14ca0409a0c55ec54.tar.gz argaze-aefefb657421d66ea66347f14ca0409a0c55ec54.tar.bz2 argaze-aefefb657421d66ea66347f14ca0409a0c55ec54.tar.xz |
Fixing entities exploration.
-rw-r--r-- | src/argaze/TobiiGlassesPro2/TobiiEntities.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/argaze/TobiiGlassesPro2/TobiiEntities.py b/src/argaze/TobiiGlassesPro2/TobiiEntities.py index 81c227f..4516b2e 100644 --- a/src/argaze/TobiiGlassesPro2/TobiiEntities.py +++ b/src/argaze/TobiiGlassesPro2/TobiiEntities.py @@ -117,8 +117,6 @@ class TobiiRecording: self.__id = os.path.basename(recording_path) self.__path = recording_path - self.__path = os.path.dirname(os.path.dirname(os.path.abspath(self.__path))) - with open(os.path.join(self.__path, TOBII_RECORD_FILENAME)) as f: try: item = json.load(f) @@ -131,11 +129,7 @@ class TobiiRecording: self.__length = int(item["rec_length"]) self.__et_samples = int(item["rec_et_samples"]) self.__et_samples_valid = int(item["rec_et_valid_samples"]) - - self.__segments = int(item["rec_segments"]) - - self.__project = TobiiProject(self.__path) - self.__participant = TobiiParticipant(self.__path) + self.__participant_id = item["rec_participant"] @property def path(self) -> str: @@ -182,15 +176,18 @@ class TobiiRecording: def project(self) -> "TobiiProject": """Get project to which it belongs.""" - return self.__project + project_path = os.path.dirname(os.path.dirname(os.path.abspath(self.__path))) + + return TobiiProject(project_path) @property def participant(self) -> "TobiiParticipant": """Get participant to which it belongs.""" - return self.__participant + project_path = os.path.dirname(os.path.dirname(os.path.abspath(self.__path))) + + return TobiiParticipant(project_path + '/participants/' + self.__participant_id) - @property def segments(self) -> list["TobiiSegment"]: """Get all recorded segments.""" @@ -283,7 +280,6 @@ class TobiiProject: return self.__creation_date - @property def participants(self) -> list["TobiiParticipant"]: """Get all participants.""" @@ -324,7 +320,6 @@ class TobiiDrive: return self.__path - @property def projects(self) -> list["TobiiProject"]: """Get all projects.""" |