aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/GazeAnalysis/DispersionThresholdIdentification.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
index 350a940..f29858a 100644
--- a/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
+++ b/src/argaze/GazeAnalysis/DispersionThresholdIdentification.py
@@ -203,6 +203,22 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
return GazeFeatures.UnvalidGazeMovement()
@property
+ def current_gaze_movement(self) -> GazeMovementType:
+
+ # It shouldn't have a current fixation and a current saccade at the same time
+ assert(not (len(self.__fixation_positions) > 0 and len(self.__saccade_positions) > 0))
+
+ if len(self.__fixation_positions) > 0:
+
+ return Fixation(self.__fixation_positions)
+
+ if len(self.__saccade_positions) > 0:
+
+ return Saccade(self.__saccade_positions)
+
+ # Always return unvalid gaze movement at least
+ return GazeFeatures.UnvalidGazeMovement()
+ @property
def current_fixation(self) -> FixationType:
if len(self.__fixation_positions) > 0:
@@ -216,7 +232,7 @@ class GazeMovementIdentifier(GazeFeatures.GazeMovementIdentifier):
def current_saccade(self) -> SaccadeType:
if len(self.__saccade_positions) > 0:
-
+
return Saccade(self.__saccade_positions)
# Always return unvalid gaze movement at least