FOVE SUPPORT CENTER

How can I quit recorder and save data by time?

Comments

2 comments

  • Avatar
    Pierre

    Hello,

    If you look at the Update function of the GazeRecorder.cs, you can see the code to start/stop the gaze recording. 

        void Update()
    {
    // If you press the assigned key, it will toggle the "recordingStopped" variable.
    if (Input.GetKeyDown(toggleRecordingKey))
    {
    shouldRecord = !shouldRecord;
    Debug.Log(shouldRecord ? "Starting" : "Stopping" + " data recording...");
    }
    }

    You can easily add public Start/Stop methods to call from the code doing the stimulus. Something like:

    void StartRecording()
    {
    shouldRecord = true;
    Debug.Log("Starting data recording...");
    }

    void StopRecording()
    {
    shouldRecord = false;
    Debug.Log("Stopping data recording...");
    }

    And something like this from your stimulus code:

    var gazeRecorder = (GazeRecorder)FindObjectOfType(typeof(GazeRecorder));

    // start the stimulus
    gazeRecorder.StarRecording();
    ... stimulus code

    // stop the stimulus
    gazeRecorder.StopRecording();
    ... stimulus code

    Hope it helped. 

    0
    Comment actions Permalink
  • Avatar
    Watanabe Takehiro

    Thank you for the fast reply and useful instructions!

    It works fine in 70hz!

    0
    Comment actions Permalink

Please sign in to leave a comment.