GazeData.js 607 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
const DATA_SEPERATOR = ";";

class GazeData {
  constructor(leftEyeX, leftEyeY, rightEyeX, rightEyeY, trackerTimeStamp,
    systemTimeStamp) {
    this.leftEyeX = leftEyeX;
    this.leftEyeY = leftEyeY;
    this.rightEyeX = rightEyeX;
    this.rightEyeY = rightEyeY;
    this.trackerTimeStamp = trackerTimeStamp;
    this.systemTimeStamp = systemTimeStamp;
  }

  static fromDataString(dataString) {
    let dataValues = dataString.split(DATA_SEPERATOR);
    return new GazeData(dataValues[0], dataValues[1], dataValues[2],
      dataValues[3], dataValues[4], dataValues[5]);
  }
}

export default GazeData;