public void StartRecording() { if (!enabled) { Debug.LogWarning("Component not enabled"); return; } if (!requestCtrl.IsConnected) { Debug.LogWarning("Not connected"); return; } if (IsRecording) { Debug.Log("Recording is already running."); return; } var path = GetRecordingPath(); requestCtrl.Send(new Dictionary <string, object> { { "subject", "recording.should_start" } , { "session_name", path } , { "record_eye", recordEyeFrames } }); IsRecording = true; //abort process on disconnecting requestCtrl.OnDisconnecting += StopRecording; }
public void StartRecording() { if (requestCtrl == null) { Debug.LogWarning("Request Controller missing"); return; } if (!requestCtrl.IsConnected) { Debug.LogWarning("Not connected"); return; } if (IsRecording) { Debug.Log("Recording is already running."); return; } var path = GetRecordingPath().Substring(2); Debug.Log($"Recording path: {path}"); requestCtrl.Send(new Dictionary <string, object> { { "subject", "recording.should_start" } , { "session_name", path } , { "record_eye", true } }); IsRecording = true; }
public void SendCalibrationReferenceData() { Debug.Log("Send CalibrationReferenceData"); requestCtrl.Send(new Dictionary <string, object> { { "subject", "calibration.add_ref_data" }, { "ref_data", calibrationData.ToArray() } }); //Clear the current calibration data, so we can proceed to the next point if there is any. calibrationData.Clear(); }
public void StartCalibration(CalibrationSettings settings, SubscriptionsController subsCtrl) { this.settings = settings; this.subsCtrl = subsCtrl; this.requestCtrl = subsCtrl.requestCtrl; requestCtrl.SetPupilTimestamp(Time.time); if (OnCalibrationStarted != null) { OnCalibrationStarted(); } IsCalibrating = true; subsCtrl.SubscribeTo("notify.calibration.successful", ReceiveSuccess); subsCtrl.SubscribeTo("notify.calibration.failed", ReceiveFailure); requestCtrl.StartPlugin(settings.PluginName); UpdateEyesTranslation(); requestCtrl.Send(new Dictionary <string, object> { { "subject", "calibration.should_start" }, { "hmd_video_frame_size", new float[] { 1000, 1000 } }, { "outlier_threshold", 35 }, { "translation_eye0", rightEyeTranslation }, { "translation_eye1", leftEyeTranslation } }); Debug.Log("Calibration Started"); calibrationData.Clear(); }
public void StartCalibration(CalibrationSettings settings, SubscriptionsController subsCtrl) { this.settings = settings; this.subsCtrl = subsCtrl; this.requestCtrl = subsCtrl.requestCtrl; if (OnCalibrationStarted != null) { OnCalibrationStarted(); } IsCalibrating = true; subsCtrl.SubscribeTo("notify.calibration.successful", ReceiveSuccess); subsCtrl.SubscribeTo("notify.calibration.failed", ReceiveFailure); requestCtrl.StartPlugin(settings.PluginName); publisher = new Publisher(requestCtrl); UpdateEyesTranslation(); requestCtrl.Send(new Dictionary <string, object> { { "subject", "calibration.should_start" }, { "translation_eye0", rightEyeTranslation }, { "translation_eye1", leftEyeTranslation }, { "record", true } }); Debug.Log("Calibration Started"); calibrationData.Clear(); }