aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-10 16:11:08 +0200
committerThéo de la Hogue2023-05-10 16:11:08 +0200
commit0f9ab55a50c1442460a2ef6e34ff77fae356c05c (patch)
tree9af3832abbdd925dce614166f9ccdd14a099d594
parent82f70c15876c93caa1836910975bf28a770857d1 (diff)
downloadargaze-0f9ab55a50c1442460a2ef6e34ff77fae356c05c.zip
argaze-0f9ab55a50c1442460a2ef6e34ff77fae356c05c.tar.gz
argaze-0f9ab55a50c1442460a2ef6e34ff77fae356c05c.tar.bz2
argaze-0f9ab55a50c1442460a2ef6e34ff77fae356c05c.tar.xz
Renaming last aoi into current aoi.
-rw-r--r--src/argaze/GazeFeatures.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py
index 95d90e1..d6011a0 100644
--- a/src/argaze/GazeFeatures.py
+++ b/src/argaze/GazeFeatures.py
@@ -376,14 +376,14 @@ VisualScanPathType = TypeVar('VisualScanPathType', bound="VisualScanPathType")
# Type definition for type annotation convenience
class VisualScanPath(list):
- """List of visual scan steps over successive aoi."""
+ """List of visual scan steps over successive AOI."""
def __init__(self):
super().__init__()
self.__movements = TimeStampedGazeMovements()
- self.__last_aoi = ''
+ self.__current_aoi = ''
def __repr__(self):
"""String representation."""
@@ -399,8 +399,16 @@ class VisualScanPath(list):
output += f'> {step.aoi} '
+ output += f'> {self.__current_aoi}'
+
return output
-
+
+ @property
+ def current_aoi(self):
+ """AOI name of visual scan step under construction"""
+
+ return self.__current_aoi
+
def append_saccade(self, ts, saccade):
"""Append new saccade to visual scan path."""
@@ -416,12 +424,12 @@ class VisualScanPath(list):
It could raise VisualScanStepError"""
# Is it fixation onto a new aoi?
- if looked_aoi != self.__last_aoi and len(self.__movements) > 0:
+ if looked_aoi != self.__current_aoi and len(self.__movements) > 0:
try:
# Edit new step
- new_step = VisualScanStep(self.__movements, self.__last_aoi)
+ new_step = VisualScanStep(self.__movements, self.__current_aoi)
# Append new step
super().append(new_step)
@@ -438,14 +446,14 @@ class VisualScanPath(list):
self.__movements[ts] = fixation
# Remember new aoi
- self.__last_aoi = looked_aoi
+ self.__current_aoi = looked_aoi
else:
# Append new fixation
self.__movements[ts] = fixation
# Remember aoi
- self.__last_aoi = looked_aoi
+ self.__current_aoi = looked_aoi
return None