CustomFixationDataStream - accessibilitysoftwarehub/OpenSourceWindowsGazeControl GitHub Wiki

General Information

Name: CustomFixationDataStream

Description: Custom fixation datastream, Monitors stream of XY coordinates of a users gaze, and from this data calculates the standard deviation variance from the gaze average. It then raises appropriate events when the users gaze is moving less than a specified threshold.

Purpose: Tracks eye locations and raises flag when focus has been in a certain place for too long.

Full Description: The Fixation stream has a list of eye locations. the statemanager is constantly sending in the eye location to the list then an algorithm is calculating the average location. If this location remains basically the same
Note:

Method Descriptions

updateGazeCoodinates Adds new coordinates to buffer. Then it calculates the new average of the buffers and calls the generateFixationState to update the state of the user's gaze.

generateFixationState Checks input data from variance calculation and raises appropriate event depending on this data and the CustomfixationDetectionStreams current state. E.g if it detects you have started fixating it will raise that flag. First it adjusts the average based on the screen boundaries.

onFixationStateChange Method that raises fixation event.

addCoordinateToBuffer add coordinates to ring buffer, check and reset array index when at end of array, increment bufferfullindex to indicate when buffer has been full for the first time, then overwrite previous data.

calculateVariance Calculates how much variance there is between the average buffer location and the total of all the items in the buffer.

ResetFixationDetectionState Reset fixation data stream to its waiting state, this solves and issue when fixations are in close proximity, by stopping the stream getting stuck in the middle stae of a fixation.

average Calculates the average location of the users gaze, could be combined into calculateVariance() method.