예제 #1
0
        /// <summary>
        /// Stop recording gaze data
        /// </summary>
        public void StopRecording()
        {
            if (!FileHandler.writingData)
            {
                Debug.LogError("[EyeTracking DataLogger] Can't stop recording as we currently aren't recording!");
            }

            // Unsubscribe from new data event
            dataProvider.NewDataEvent -= NewDataHandler;

            // Update the recording information
            CurrentRecording.stopTime          = DateTime.Now;
            CurrentRecording.recordingDuration = CurrentRecording.stopTime - CurrentRecording.startTime;

            // Write the new information file
            FileHandler.WriteInformation(JsonUtility.ToJson(new JSON.RecordingInfo(CurrentRecording), true), true);

            // Stop the current log
            FileHandler.StopDataLog();

            Debug.Log("[EyeTracking DataLogger] Stopped recording");
        }