Beispiel #1
0
    void CloseShop()
    {
                #if UNITY_EDITOR // Operator window will only be available in Editor mode
        if (OperatorWindow.Instance != null)
        {
            OperatorWindow.Instance.Close();
        }
                #endif

        if (Settings.DataProcessState == PupilSettings.EStatus.Calibration)
        {
            PupilTools.StopCalibration();
        }

        PupilTools.StopEyeProcesses();

        Thread.Sleep(1);

        Settings.connection.CloseSockets();

        StopAllCoroutines();

        if (Recorder.isRecording)
        {
            Recorder.Stop();
        }

        PupilTools.RepaintGUI();

        Pupil.processStatus.eyeProcess0 = false;
        Pupil.processStatus.eyeProcess1 = false;
    }
Beispiel #2
0
    void Update()
    {
        if (updateInitialTranslation)
        {
            //might be inconsistent during the first frames -> updating until calibration starts
            UpdateEyesTranslation();
        }

        if (PupilTools.IsCalibrating)
        {
            PupilTools.Calibration.UpdateCalibration();
        }

        PupilTools.Connection.UpdateSubscriptionSockets();

        if (PupilTools.IsConnected && Input.GetKeyUp(KeyCode.C))
        {
            if (PupilTools.IsCalibrating)
            {
                PupilTools.StopCalibration();
            }
            else
            {
                PupilTools.StartCalibration();
                updateInitialTranslation = false;
            }
        }
#if !UNITY_WSA
        if (Input.GetKeyUp(KeyCode.R))
        {
            if (PupilTools.IsConnected)
            {
                if (!Recorder.isRecording)
                {
                    Recorder.isRecording = true;
                    Recorder.Start();
                }
                else
                {
                    Recorder.isRecording = false;
                    Recorder.Stop();
                }
            }
            else
            {
                print("Can not start recording without connection to pupil service");
            }
        }
#endif

        if (Instance.OnUpdate != null)
        {
            Instance.OnUpdate();
        }
    }
    void Update()
    {
        if (PupilTools.IsCalibrating)
        {
            PupilTools.Calibration.UpdateCalibration();
        }

        PupilTools.Connection.UpdateSubscriptionSockets();

        if (PupilTools.IsConnected && Input.GetKeyUp(KeyCode.C))
        {
            if (PupilTools.IsCalibrating)
            {
                PupilTools.StopCalibration();
            }
            else
            {
                PupilTools.StartCalibration();
            }
        }
#if !UNITY_WSA
        //Start Recording as soon as the scene is loaded after calibration successfully ended
        if (PupilTools.IsGazing)
        {
            if (!Recorder.isRecording)
            {
                Recorder.isRecording = true;
                Recorder.Start();
            }
        }
        //if (Input.GetKeyUp(KeyCode.R))
        //{
        //    if (PupilTools.IsConnected)
        //    {
        //        if (!Recorder.isRecording)
        //        {
        //            Recorder.isRecording = true;
        //            Recorder.Start();
        //        }
        //        else
        //        {
        //            Recorder.isRecording = false;
        //            Recorder.Stop();
        //        }
        //    }
        //    else
        //        print("Can not start recording without connection to pupil service");
        //}
#endif

        if (Instance.OnUpdate != null)
        {
            Instance.OnUpdate();
        }
    }
Beispiel #4
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.D))
        {
            moreGazeDots = !moreGazeDots;
        }

        if (PupilTools.IsCalibrating)
        {
            PupilTools.Calibration.UpdateCalibration();
        }

        PupilTools.Connection.UpdateSubscriptionSockets();

        if (PupilTools.IsConnected && Input.GetKeyUp(KeyCode.C))
        {
            if (PupilTools.IsCalibrating)
            {
                PupilTools.StopCalibration();
            }
            else
            {
                PupilTools.StartCalibration();
            }
        }
#if !UNITY_WSA
        if (Input.GetKeyUp(KeyCode.R))
        {
            if (PupilTools.IsConnected)
            {
                if (!Recorder.isRecording)
                {
                    Recorder.isRecording = true;
                    Recorder.Start();
                }
                else
                {
                    Recorder.isRecording = false;
                    Recorder.Stop();
                }
            }
            else
            {
                print("Can not start recording without connection to pupil service");
            }
        }
#endif

        if (Instance.OnUpdate != null)
        {
            Instance.OnUpdate();
        }
    }
Beispiel #5
0
    void Update()
    {
        Settings.framePublishing.UpdateEyeTextures();

        if (Settings.DataProcessState == PupilSettings.EStatus.Calibration)
        {
            if (Settings.calibration.currentStatus == Calibration.Status.Started)
            {
                Settings.calibration.UpdateCalibration();
            }
        }

        Settings.connection.UpdateSubscriptionSockets();

        if (Input.GetKeyUp(KeyCode.C))
        {
            if (Settings.DataProcessState == PupilSettings.EStatus.Calibration)
            {
                PupilTools.StopCalibration();
            }
            else
            {
                PupilTools.StartCalibration();
            }
        }
#if !UNITY_WSA
        if (Input.GetKeyUp(KeyCode.R))
        {
            if (Settings.connection.isConnected)
            {
                if (!Recorder.isRecording)
                {
                    Recorder.isRecording = true;
                    Recorder.Start();
                }
                else
                {
                    Recorder.isRecording = false;
                    Recorder.Stop();
                }
            }
            else
            {
                print("Can not start recording without connection to pupil service");
            }
        }
#endif

        if (OnUpdate != null)
        {
            OnUpdate();
        }
    }
Beispiel #6
0
 public void OnCalibrationButtonClicked()
 {
     if (PupilTools.IsCalibrating)
     {
         PupilTools.StopCalibration();
     }
     else
     {
         PupilTools.StartCalibration();
         ResetCanvasUI(false);
         calibrationText.text = "";
     }
 }
 public void OnCalibrationButtonClicked()
 {
     if (PupilTools.DataProcessState == Pupil.EStatus.Calibration)
     {
         PupilTools.StopCalibration();
     }
     else
     {
         PupilTools.StartCalibration();
         ResetCanvasUI(false);
         calibrationText.text = "";
     }
 }
Beispiel #8
0
    void Update()
    {
        Settings.framePublishing.UpdateEyeTextures();

        if (Settings.dataProcess.state == PupilSettings.EStatus.Calibration)
        {
            if (Settings.calibration.initialized)
            {
                PupilTools.Calibrate();
            }
        }
        else if (Settings.connection.subscribeSocket != null)
        {
            Settings.connection.subscribeSocket.Poll();
        }

        if (Input.GetKeyUp(KeyCode.C))
        {
            if (Settings.dataProcess.state == PupilSettings.EStatus.Calibration)
            {
                PupilTools.StopCalibration();
            }
            else
            {
                //LoggerBehavior.SceneStatus = "calibrating";
                PupilTools.StartCalibration();
            }
        }
        if (Input.GetKeyUp(KeyCode.R))
        {
            if (!Recorder.isRecording)
            {
                Recorder.isRecording = true;
                Recorder.Start();
            }
            else
            {
                Recorder.isRecording = false;
                Recorder.Stop();
            }
        }

        if (OnUpdate != null)
        {
            OnUpdate();
        }
    }
    static float timeBetweenCalibrationPoints = 0.02f;     // was 0.1, 1000/60 ms wait in old version
    public void UpdateCalibration()
    {
        float t = Time.time;        // PupilSettings.Instance.connection.currentPupilTimestamp;

        if (t - lastTimeStamp > timeBetweenCalibrationPoints)
        {
            lastTimeStamp = t;

            UpdateCalibrationPoint();             // .currentCalibrationType.calibPoints [currentCalibrationPoint];
            //			print ("its okay to go on");

            //Adding the calibration reference data to the list that wil;l be passed on, once the required sample amount is met.
            if (currentCalibrationSamples > samplesToIgnoreForEyeMovement)
            {
                PupilTools.AddCalibrationPointReferencePosition(currentCalibrationPointPosition, t);
            }

            if (PupilSettings.Instance.debug.printSampling)
            {
                Debug.Log("Point: " + currentCalibrationPoint + ", " + "Sampling at : " + currentCalibrationSamples + ". On the position : " + currentCalibrationPointPosition [0] + " | " + currentCalibrationPointPosition [1]);
            }

            currentCalibrationSamples++;            //Increment the current calibration sample. (Default sample amount per calibration point is 120)

            if (currentCalibrationSamples >= currentCalibrationType.samplesPerDepth)
            {
                currentCalibrationSamples = 0;
                currentCalibrationDepth++;

                if (currentCalibrationDepth >= currentCalibrationType.vectorDepthRadius.Length)
                {
                    currentCalibrationDepth = 0;
                    currentCalibrationPoint++;

                    //Send the current relevant calibration data for the current calibration point. _CalibrationPoints returns _calibrationData as an array of a Dictionary<string,object>.
                    PupilTools.AddCalibrationReferenceData();

                    if (currentCalibrationPoint >= currentCalibrationType.points)
                    {
                        PupilTools.StopCalibration();
                    }
                }
            }
        }
    }
Beispiel #10
0
    public static void Disconnect()
    {
        if (OnDisconnecting != null)
        {
            OnDisconnecting();
        }

        if (DataProcessState == EStatus.Calibration)
        {
            PupilTools.StopCalibration();
        }

        // Starting/Stopping eye process is now part of initialization process
        //PupilTools.StopEyeProcesses ();

        Connection.CloseSubscriptionSocket("gaze");

        Connection.CloseSockets();
    }
Beispiel #11
0
    private void DrawMainMenu()
    {
        Event e = Event.current;

        GUILayout.Space(10);

        ////////////////////////////CALIBRATE BUTTON////////////////////////////
        if (PupilTools.IsConnected)
        {
            if (!PupilTools.IsCalibrating)
            {
                if (GUILayout.Button("Start Calibration", GUILayout.Height(50)))
                {
                    if (Application.isPlaying)
                    {
                        PupilTools.StartCalibration();
                        //EditorApplication.update += CheckCalibration;
                    }
                    else
                    {
                        EditorUtility.DisplayDialog("Pupil service message", "You can only use calibration in playmode", "Understood");
                    }
                }
            }
            else
            {
                if (GUILayout.Button("Stop Calibration", GUILayout.Height(50)))
                {
                    PupilTools.StopCalibration();
                }
            }
        }
        else
        {
            GUI.enabled = false;
            GUILayout.Button("Start Calibration (Requires Connection to Pupil)", GUILayout.Height(50));
        }
        GUI.enabled = true;
        ////////////////////////////CALIBRATE BUTTON////////////////////////////

        GUILayout.Space(5);

        ////////////////////////////RECORDING BUTTON////////////////////////////
        if (PupilTools.IsConnected)
        {
            EditorGUI.BeginChangeCheck();

            Recorder.isRecording = GUILayout.Toggle(Recorder.isRecording, !Recorder.isRecording ? "Start Recording" : "Stop Recording", "Button", GUILayout.Height(50));

            GUI.enabled         = true;
            GUI.backgroundColor = Color.white;
            if (EditorGUI.EndChangeCheck())
            {
                if (Recorder.isRecording)
                {
                    Recorder.Start();
                    EditorApplication.update += CheckRecording;
                    EditorUtility.SetDirty(target);
                }
                else
                {
                    Recorder.Stop();
                }
            }
        }
        else
        {
            GUI.enabled = false;
            GUILayout.Button("Start Recording (Requires Connection to Pupil)", GUILayout.Height(50));
        }
        GUI.enabled = true;
        ////////////////////////////RECORDING BUTTON////////////////////////////

        GUILayout.Space(20);

        GUI.skin  = default(GUISkin);
        GUI.depth = 0;
        GUI.color = Color.white;
        GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));//Separator Line
        GUI.depth = 1;
        GUI.color = Color.white;

        if (pupilSettings.customGUIVariables.bools.isAdvanced)
        {
            if (GUILayout.Button("IsConnected"))
            {
                PupilTools.IsConnected = true;
            }

            GUI.backgroundColor = Color.white;
            GUILayout.Space(10);

            pupilSettings.debug.printSampling = GUILayout.Toggle(pupilSettings.debug.printSampling, "Print Sampling", "Button");

            pupilSettings.debug.printMessage = GUILayout.Toggle(pupilSettings.debug.printMessage, "Print Msg", "Button");

            pupilSettings.debug.printMessageType = GUILayout.Toggle(pupilSettings.debug.printMessageType, "Print Msg Types", "Button");
        }
    }
Beispiel #12
0
    private void DrawMainMenu()
    {
        Event e = Event.current;

        GUILayout.Space(10);

        ////////////////////////////CALIBRATE BUTTON////////////////////////////
        if (PupilTools.Settings.connection.isConnected)
        {
            if (PupilTools.Settings.dataProcess.state != PupilSettings.EStatus.Calibration)
            {
                if (GUILayout.Button("Calibrate", GUILayout.Height(50)))
                {
                    if (Application.isPlaying)
                    {
                        PupilTools.StartCalibration();
                        //EditorApplication.update += CheckCalibration;
                    }
                    else
                    {
                        EditorUtility.DisplayDialog("Pupil service message", "You can only use calibration in playmode", "Understood");
                    }
                }
            }
            else
            {
                if (GUILayout.Button("Stop Calibration", GUILayout.Height(50)))
                {
                    PupilTools.StopCalibration();
                }
            }
        }
        else
        {
            GUI.enabled = false;
            GUILayout.Button("Calibrate (Not Connected !)", GUILayout.Height(50));
        }
        GUI.enabled = true;
        ////////////////////////////CALIBRATE BUTTON////////////////////////////

        GUILayout.Space(5);

        ////////////////////////////RECORDING BUTTON////////////////////////////
        EditorGUI.BeginChangeCheck();

        if (Recorder.isProcessing)
        {
            GUI.enabled          = false;
            Recorder.isRecording = GUILayout.Toggle(Recorder.isRecording, "Processing ... ", "Button", GUILayout.Height(50));
        }
        else
        {
            Recorder.isRecording = GUILayout.Toggle(Recorder.isRecording, "Recording", "Button", GUILayout.Height(50));
        }

        GUI.enabled         = true;
        GUI.backgroundColor = Color.white;
        if (EditorGUI.EndChangeCheck())
        {
            if (Recorder.isRecording)
            {
                Recorder.Start();
                EditorApplication.update += CheckRecording;
                EditorUtility.SetDirty(target);
            }
            else
            {
                Recorder.Stop();
            }
        }

        ////////////////////////////RECORDING BUTTON////////////////////////////
        ///
        GUILayout.Space(5);

        ////////////////////////////OPERATOR MONITOR BUTTON////////////////////////////
        EditorGUI.BeginChangeCheck();
        pupilTracker.isOperatorMonitor = GUILayout.Toggle(pupilTracker.isOperatorMonitor, "Operator Monitor", "Button", GUILayout.MinWidth(100), GUILayout.Height(50));
        if (EditorGUI.EndChangeCheck())
        {
            if (pupilTracker.isOperatorMonitor)
            {
                pupilTracker.debugInstance.CloseCalibrationDebugView();
                //				Debug.Log("instantiate operator monitor");
                OperatorMonitor.Instantiate();
            }
            else
            {
                if (pupilTracker.OperatorMonitorProperties[0].OperatorCamera != null)
                {
                    OperatorMonitor.Instance.ExitOperatorMonitor();
                }
            }
        }
        ////////////////////////////OPERATOR MONITOR BUTTON////////////////////////////

        GUILayout.Space(10);

        GUI.skin = default(GUISkin);

        GUILayout.Space(100);

        GUI.depth = 0;
        GUI.color = Color.white;
        GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.Height(1));//Separator Line
        GUI.depth = 1;
        GUI.color = Color.white;

        if (pupilSettings.customGUIVariables.bools.isAdvanced)
        {
            if (GUILayout.Button("IsConnected"))
            {
                PupilTools.Settings.connection.isConnected = true;
            }
            //			pupilTracker.debugInstance.DebugVariables.packetsOnMainThread = GUILayout.Toggle (pupilTracker.debugInstance.DebugVariables.packetsOnMainThread, "Process Packets on Main Thread", "Button", GUILayout.MinWidth (100));

            GUI.backgroundColor = Color.white;
            GUILayout.Space(10);

            pupilSettings.debug.printSampling = GUILayout.Toggle(pupilSettings.debug.printSampling, "Print Sampling", "Button");

            pupilSettings.debug.printMessage = GUILayout.Toggle(pupilSettings.debug.printMessage, "Print Msg", "Button");

            pupilSettings.debug.printMessageType = GUILayout.Toggle(pupilSettings.debug.printMessageType, "Print Msg Types", "Button");

            //			pupilTracker.DebugVariables.subscribeAll = GUILayout.Toggle (pupilTracker.DebugVariables.subscribeAll, "Subscribe to all", "Button");
            //
            //			pupilTracker.DebugVariables.subscribeFrame = GUILayout.Toggle (pupilTracker.DebugVariables.subscribeFrame, "Subscribe to frame.", "Button");
            //
            //			pupilTracker.DebugVariables.subscribeGaze = GUILayout.Toggle (pupilTracker.DebugVariables.subscribeGaze, "Subscribe to gaze.", "Button");
            //
            //			pupilTracker.DebugVariables.subscribeNotify = GUILayout.Toggle (pupilTracker.DebugVariables.subscribeNotify, "Subscribe to notifications.", "Button");
        }
    }
    public void InterpreteUDPData(byte[] data)
    {
        switch (data[0])
        {
        // Connection established
        case (byte)'0':
            switch (data [1])
            {
            case (byte)'I':
                UnityEngine.Debug.Log("Connection established");
                PupilTools.IsConnected = true;
                break;

            case (byte)'i':
                UnityEngine.Debug.Log("Connection closed");
                PupilTools.IsConnected = false;
                break;

            case (byte)'S':
                // Start gazing command received
                break;

            case (byte)'s':
                // Stop gazing command received
                break;

            default:
                UnityEngine.Debug.Log("Unknown response: " + (char)data[1]);
                break;
            }
            break;

        case (byte)'E':
            switch (data [1])
            {
            case (byte)'C':
                if (data [2] == (byte)'S')                  // "notify.calibration.successful"
                {
                    UnityEngine.Debug.Log("notify.calibration.successful");
                    PupilTools.CalibrationFinished();
                }
                else if (data [2] == (byte)'F')                    // "notify.calibration.failed"
                {
                    UnityEngine.Debug.Log("notify.calibration.failed");
                    PupilTools.CalibrationFailed();
                }
                else
                {
                    UnityEngine.Debug.Log("Unknown calibration ended event");
                }
                break;

            case (byte)'G':
                if (data [2] == (byte)'2')
                {
                    if (data [3] == (byte)'1')
                    {
                        //UnityEngine.Debug.Log("Left eye position received");
                        var leftEyePosition = FloatArrayFromPacket(data, 4);
                        PupilData._2D.LeftEyePosUDP.x = leftEyePosition [0];
                        PupilData._2D.LeftEyePosUDP.y = leftEyePosition [1];
//					    UnityEngine.Debug.Log ("Left eye position: " + PupilData._2D.LeftEyePosUDP.ToString());
                    }
                    else if (data [3] == (byte)'0')
                    {
                        //UnityEngine.Debug.Log("Right eye position received");
                        var rightEyePosition = FloatArrayFromPacket(data, 4);
                        PupilData._2D.RightEyePosUDP.x = rightEyePosition [0];
                        PupilData._2D.RightEyePosUDP.y = rightEyePosition [1];
//					    UnityEngine.Debug.Log ("Right Eye Position: " + PupilData._2D.RightEyePosUDP.ToString());
                    }
                    else if (data [3] == (byte)'2')
                    {
                        var gaze2DPosition = FloatArrayFromPacket(data, 4);
                        PupilData._2D.Gaze2DPosUDP.x = gaze2DPosition [0];
                        PupilData._2D.Gaze2DPosUDP.y = gaze2DPosition [1];
//					    UnityEngine.Debug.Log ("Gazepoint 2D: " + PupilData._2D.Gaze2DPosUDP.ToString());
                    }
                    else
                    {
                        UnityEngine.Debug.Log("Unknown gaze 2d data");
                    }
                }
                else if (data [2] == (byte)'3')
                {
                    var gaze3DPosition = FloatArrayFromPacket(data, 4);
                    PupilData._3D.Gaze3DPosUDP.x = gaze3DPosition [0] / PupilSettings.PupilUnitScalingFactor;
                    PupilData._3D.Gaze3DPosUDP.y = gaze3DPosition [1] / PupilSettings.PupilUnitScalingFactor;
                    PupilData._3D.Gaze3DPosUDP.z = gaze3DPosition [2] / PupilSettings.PupilUnitScalingFactor;
//					UnityEngine.Debug.Log ("Gazepoint 3D: " + PupilData._3D.Gaze3DPosUDP.ToString());
                }
                else
                {
                    UnityEngine.Debug.Log("Unknown gaze event");
                }
                break;

            default:
                UnityEngine.Debug.Log("Unknown event");
                break;
            }
            break;

        case 90:
            UnityEngine.Debug.Log("Start/stop calibration command");
            if (data [1] == 1)
            {
                PupilTools.StartCalibration();
            }
            else
            {
                PupilTools.StopCalibration();
            }
            break;

        case 91:
            UnityEngine.Debug.Log("Forcing 2D calibration mode (Pupil version < 1 detected)");
            PupilTools.CalibrationMode = Calibration.Mode._2D;
            break;

        default:
            UnityEngine.Debug.Log(StringFromPacket(data));
            break;
        }
    }
Beispiel #14
0
    public void InterpreteUDPData(byte[] data)
    {
        if (debuging)
        {
            Debug.Log("Receive data: " + Encoding.ASCII.GetString(data));
        }
        switch (data[0])
        {
        // Connection established
        case (byte)'0':
            switch (data [1])
            {
            case (byte)'I':
                UnityEngine.Debug.Log("Connection established");
                PupilTools.IsConnected = true;
                break;

            case (byte)'i':
                UnityEngine.Debug.Log("Connection closed");
                PupilTools.IsConnected = false;
                break;

            case (byte)'S':
                // Start gazing command received
                break;

            case (byte)'s':
                // Stop gazing command received
                break;

            default: {
                UnityEngine.Debug.Log("Unknown response: " + (char)data[1]);
                debuging = false;
            }
            break;
            }
            break;

        case (byte)'E':
            switch (data [1])
            {
            case (byte)'C':
                if (data [2] == (byte)'S')                  // "notify.calibration.successful"
                {
                    UnityEngine.Debug.Log("notify.calibration.successful");
                    PupilTools.CalibrationFinished();
                }
                else if (data [2] == (byte)'F')                    // "notify.calibration.failed"
                {
                    UnityEngine.Debug.Log("notify.calibration.failed");
                    PupilTools.CalibrationFailed();
                }
                else
                {
                    UnityEngine.Debug.Log("Unknown calibration ended event");
                }
                break;

            case (byte)'G':
                if (data [2] == (byte)'2')
                {
                    if (data [3] == (byte)'1')
                    {
                        //UnityEngine.Debug.Log("Left eye position received");
                        PupilTools.UpdateGazePostion(PupilSettings.gaze2DLeftEyeKey, FloatArrayFromPacket(data, 4));
                    }
                    else if (data [3] == (byte)'0')
                    {
                        //UnityEngine.Debug.Log("Right eye position received");
                        PupilTools.UpdateGazePostion(PupilSettings.gaze2DRightEyeKey, FloatArrayFromPacket(data, 4));
                    }
                    else if (data [3] == (byte)'2')
                    {
                        PupilTools.UpdateGazePostion(PupilSettings.gaze2DKey, FloatArrayFromPacket(data, 4));
                    }
                    else
                    {
                        UnityEngine.Debug.Log("Unknown gaze 2d data");
                    }
                }
                else if (data [2] == (byte)'3')
                {
                    PupilTools.UpdateGazePostion(PupilSettings.gaze3DKey, FloatArrayFromPacket(data, 4));
                }
                else
                {
                    UnityEngine.Debug.Log("Unknown gaze event");
                }
                break;

            default:
                UnityEngine.Debug.Log("Unknown event");
                break;
            }
            break;

        case 90:
            UnityEngine.Debug.Log("Start/stop calibration command");
            if (data [1] == 1)
            {
                PupilTools.StartCalibration();
            }
            else
            {
                PupilTools.StopCalibration();
            }
            break;

        case 91:
            UnityEngine.Debug.Log("Forcing 2D calibration mode (Pupil version < 1 detected)");
            PupilTools.CalibrationMode = Calibration.Mode._2D;
            break;

        case (byte)'R':
            if (PupilSettings.Instance.debug.printSampling)
            {
                Debug.Log("Reference points received");
            }
            break;

        default:
            UnityEngine.Debug.Log(StringFromPacket(data));
            break;
        }
    }