Exemple #1
0
    public void LogFileFrameWriting()
    {
        timestamp = DateTime.Now - taskStart;

        //POSICAO USER
        User1Posicao = User1Pos.transform.position;
        User2Posicao = User2Pos.transform.position;

        //POSICAO MAOS USER
        U1RH = User1RightHandPos.transform.position;
        U1LH = User1LeftHandPos.transform.position;
        U2RH = User2RightHandPos.transform.position;
        U2LH = User1LeftHandPos.transform.position;

        //POSICAO DO TOQUE e TEMPO DE TOQUE DE CADA USER:
        bool newUser1hasTouch = User1Pos.GetComponent <User>().handRight.userTouch.touch != null;

        if (!User1hasTouch && newUser1hasTouch)
        {
            User1TouchStart = timestamp;
            if (User2hasTouch)
            {
                UserSimultaneousStart = timestamp;
            }
        }
        if (User1hasTouch && !newUser1hasTouch)
        {
            User1TouchTime += (timestamp - User1TouchStart).TotalMilliseconds;
            if (User2hasTouch)
            {
                UserSimultaneousEnd        = timestamp;
                UserSimultaneousTouchTime += (UserSimultaneousEnd - UserSimultaneousStart).TotalMilliseconds;
            }
        }

        User1hasTouch = newUser1hasTouch;
        if (User1hasTouch)
        {
            PosTouchU1 = User1Pos.GetComponent <User>().handRight.userTouch.touch.transform.position;
        }


        bool newUser2hasTouch = User2Pos.GetComponent <User>().handRight.userTouch.touch != null;

        if (!User2hasTouch && newUser2hasTouch)
        {
            User2TouchStart = timestamp;
            if (User1hasTouch)
            {
                UserSimultaneousStart = timestamp;
            }
        }
        if (User2hasTouch && !newUser2hasTouch)
        {
            User2TouchTime += (timestamp - User2TouchStart).TotalMilliseconds;
            if (User1hasTouch)
            {
                UserSimultaneousEnd        = timestamp;
                UserSimultaneousTouchTime += (UserSimultaneousEnd - UserSimultaneousStart).TotalMilliseconds;
            }
        }


        User2hasTouch = newUser2hasTouch;
        if (User2hasTouch)
        {
            PosTouchU2 = User2Pos.GetComponent <User>().handRight.userTouch.touch.transform.position;
        }


        //TIPO DE TOQUE - Tap, DoubleTap, Drag
        U1TouchType = User1TouchType.GetComponent <UserTouch>().typeOfTouch;
        U2TouchType = User2TouchType.GetComponent <UserTouch>().typeOfTouch;

        if (U1TouchType != "drag" || U2TouchType != "drag")
        {
            User1TouchType.GetComponent <UserTouch>().typeOfTouch = User2TouchType.GetComponent <UserTouch>().typeOfTouch = null;
        }

        //TIPO DE ACAO - in_object, Select, Error, Exit
        U1Action = User1Action.GetComponent <ColliderObj>().actionIsNow;
        U2Action = User2Action.GetComponent <ColliderObj>().actionIsNow;

        User1Action.GetComponent <ColliderObj>().actionIsNow = User2Action.GetComponent <ColliderObj>().actionIsNow = null;

        //NOME DO OBJETO NO UNITY
        HoverUNU1 = HoverU1.GetComponent <ColliderObj>().collidingObject;
        HoverUNU2 = HoverU2.GetComponent <ColliderObj>().collidingObject;

        //TIPO DE OBJETO - Quadrado, Circulo, Triangulo
        HoverOTU1 = HoverU1.GetComponent <ColliderObj>().objectHoverName;
        HoverOTU2 = HoverU2.GetComponent <ColliderObj>().objectHoverName;

        //CONTAGEM DE SELECOES E TOTAIS
        sqTotal          = NQuadToSelect.GetComponent <ColliderObj>().squares_findTotal;
        ccTotal          = NCircToSelect.GetComponent <ColliderObj>().circles_findTotal;
        incSQ            = NQuadToSelect.GetComponent <ColliderObj>().squares_inc;
        incCC            = NCircToSelect.GetComponent <ColliderObj>().circles_inc;
        NumQuadsToSelect = sqTotal - incSQ; //pelo User1
        NumCircsToSelect = ccTotal - incCC; //pelo User2

        //LAST COLLIDING OBJECT
        U1LastColliding     = LastCollidingObj1.GetComponent <ColliderObj>().lastCollidingObject;
        U2LastColliding     = LastCollidingObj2.GetComponent <ColliderObj>().lastCollidingObject;
        LastCollidingTypeU1 = HoverU1.GetComponent <ColliderObj>().objectLastCollidingName;
        LastCollidingTypeU2 = HoverU2.GetComponent <ColliderObj>().objectLastCollidingName;

        //POSICAO DO CUBINHO
        HandCubeU1 = HandCube1Pos.transform.position;
        HandCubeU2 = HandCube2Pos.transform.position;

        //Keys
        GodTimes   = HoverU1.GetComponent <ColliderObj>().pressGod;
        SpaceTimes = repocess.GetComponent <NewTouch>().repro;
        HTimes     = repocess.GetComponent <NewTouch>().agás;

        if (HoverU1.GetComponent <ColliderObj>().PressingG)
        {
            GodIs = "GOD ON";
        }
        else
        {
            GodIs = "-";
        }
        if (repocess.GetComponent <NewTouch>().isRep)
        {
            SpaceIs = "SPACE ON";
        }
        else
        {
            SpaceIs = "-";
        }
        if (repocess.GetComponent <NewTouch>().isH)
        {
            HIs = "Trocou toque com tecla";
        }
        else
        {
            HIs = "-";
        }

        /*****************
        *  PARA O AGLOMERATE
        *****************/

        //Numero de Nulos, triangulos e outros que tentaram ser selecionados
        //E TIMESTAMPS

        if (U1TouchType == "double-tap")
        {
            if (LastCollidingTypeU1 == "triangle")
            {
                NumSelecoesErradasTU1++;
                TimeStampSelecoesErradasU1.Add(timestamp.TotalMilliseconds);
            }
            if (LastCollidingTypeU1 == "circle")
            {
                NumSelecoesErradasOU1++;
                TimeStampSelecoesErradasU1.Add(timestamp.TotalMilliseconds);
            }
            if (LastCollidingTypeU1 == "square" && U1Action == "vazio" || LastCollidingTypeU1 == "")
            {
                NumSelecoesVaziasU1++;
                TimeStampVaziosU1.Add(timestamp.TotalMilliseconds);
            }
        }
        if (U2TouchType == "double-tap")
        {
            if (LastCollidingTypeU2 == "triangle")
            {
                NumSelecoesErradasTU2++;
                TimeStampSelecoesErradasU2.Add(timestamp.TotalMilliseconds);
            }
            if (LastCollidingTypeU2 == "square")
            {
                NumSelecoesErradasOU2++;
                TimeStampSelecoesErradasU2.Add(timestamp.TotalMilliseconds);
            }
            if (LastCollidingTypeU2 == "circle" && U2Action == "vazio" || LastCollidingTypeU2 == "")
            {
                NumSelecoesVaziasU2++;
                TimeStampVaziosU2.Add(timestamp.TotalMilliseconds);
            }
        }

        if (U1Action == "exit")
        {
            LastLastColliding1 = U1LastColliding;
        }
        if (U1Action == "in_objeto")
        {
            if (LastLastColliding1 == U1LastColliding)
            {
                if (LastCollidingTypeU1 == "square") // sao os target do user 1
                {
                    TargetReentersU1++;
                }
            }
        }

        if (U2Action == "exit")
        {
            LastLastColliding2 = U2LastColliding;
        }
        if (U2Action == "in_objeto")
        {
            if (LastLastColliding2 == U2LastColliding)
            {
                if (LastCollidingTypeU2 == "circle") // sao os targets do user 2
                {
                    TargetReentersU2++;
                }
            }
        }

        // Adiciona o texto ao documento Log frame-a-frame
        text.Add(timestamp.TotalMilliseconds + ":" + "User 1" + ":" +
                 User1Posicao.x + ":" + User1Posicao.y + ":" + User1Posicao.z + ":" +
                 U1RH.x + ":" + U1RH.y + ":" + U1RH.z + ":" +
                 U1LH.x + ":" + U1LH.y + ":" + U1LH.z + ":" +
                 User1hasTouch + ":" +
                 (User1hasTouch? "" + (PosTouchU1.x + ":" + PosTouchU1.y + ":" + PosTouchU1.z) : "" + null + ":" + null + ":" + null) + ":" +
                 U1TouchType + ":" +
                 U1Action + ":" +
                 HoverUNU1 + ":" +
                 HoverOTU1 + ":" +
                 NumQuadsToSelect + ":" +
                 NumCircsToSelect + ":" +
                 U1LastColliding + ":" +
                 LastCollidingTypeU1 + ":" +
                 HandCubeU1.x + ":" + HandCubeU1.y + ":" + HandCubeU1.z + ":" +
                 GodIs + ":" +
                 SpaceIs + ":" +
                 HIs);

        text.Add(timestamp.TotalMilliseconds + ":" + "User 2" + ":" +
                 User2Posicao.x + ":" + User2Posicao.y + ":" + User2Posicao.z + ":" +
                 U2RH.x + ":" + U2RH.y + ":" + U2RH.z + ":" +
                 U2LH.x + ":" + U2LH.y + ":" + U2LH.z + ":" +
                 User2hasTouch + ":" +
                 (User2hasTouch ? "" + (PosTouchU2.x + ":" + PosTouchU2.y + ":" + PosTouchU2.z) : "" + null + ":" + null + ":" + null) + ":" +
                 U2TouchType + ":" +
                 U2Action + ":" +
                 HoverUNU2 + ":" +
                 HoverOTU2 + ":" +
                 NumQuadsToSelect + ":" +
                 NumCircsToSelect + ":" +
                 U2LastColliding + ":" +
                 LastCollidingTypeU2 + ":" +
                 HandCubeU2.x + ":" + HandCubeU2.y + ":" + HandCubeU2.z + ":" +
                 GodIs + ":" +
                 SpaceIs + ":" +
                 HIs);
    }
Exemple #2
0
    private void ResetAll()
    {
        taskStart = DateTime.Now;

        CompletedTask  = false;
        text           = new List <string>();
        textAglomerate = new List <string>();
        textStory      = new List <string>();
        //POSICAO USER de novo
        User1Posicao = User1Pos.transform.position;
        User2Posicao = User2Pos.transform.position;

        //POSICAO MAOS USER de novo
        U1RH          = User1RightHandPos.transform.position;
        U1LH          = User1LeftHandPos.transform.position;
        U2RH          = User2RightHandPos.transform.position;
        U2LH          = User1LeftHandPos.transform.position;
        User1hasTouch = false;
        User2hasTouch = false;
        //incSQ = NQuadToSelect.GetComponent<ColliderObj>().squares_inc;
        //incCC = NCircToSelect.GetComponent<ColliderObj>().circles_inc;
        incSQ            = 0;
        incCC            = 0;
        NumQuadsToSelect = NQuadToSelect.GetComponent <ColliderObj>().squares_findTotal;
        NumCircsToSelect = NCircToSelect.GetComponent <ColliderObj>().circles_findTotal;
        HandCubeU1.x     = -1000000;
        HandCubeU1.y     = -1000000;
        HandCubeU1.z     = -1000000;
        HandCubeU2.x     = -1000000;
        HandCubeU2.y     = -1000000;
        HandCubeU2.z     = -1000000;
        HandCube1Pos.transform.localPosition = HandCubeU1;
        HandCube2Pos.transform.localPosition = HandCubeU2;
        U1LastColliding            = null;
        U2LastColliding            = null;
        LastLastColliding1         = null;
        LastLastColliding2         = null;
        HoverOTU1                  = "";
        HoverOTU2                  = "";
        LastCollidingTypeU1        = "";
        LastCollidingTypeU2        = "";
        U1TouchType                = null;
        U2TouchType                = null;
        NumSelecoesVaziasU1        = 0;
        NumSelecoesVaziasU2        = 0;
        NumSelecoesErradasTU1      = 0;
        NumSelecoesErradasTU2      = 0;
        NumSelecoesErradasOU1      = 0;
        NumSelecoesErradasOU2      = 0;
        TSQuadrados                = "";
        TSCirculos                 = "";
        TSVaziosU1                 = "";
        TSVaziosU2                 = "";
        TSErradasU1                = "";
        TSErradasU2                = "";
        TimeStampQuadrados         = new ArrayList();
        TimeStampCirculos          = new ArrayList();
        TimeStampVaziosU1          = new ArrayList();
        TimeStampVaziosU2          = new ArrayList();
        TimeStampSelecoesErradasU1 = new ArrayList();
        TimeStampSelecoesErradasU2 = new ArrayList();
        TempoSelecaoQuadrados      = 0;
        TempoSelecaoCirculos       = 0;
        TempoTotalTarefa           = 0;
        User1TouchTime             = 0;
        User2TouchTime             = 0;
        UserSimultaneousTouchTime  = 0;
        TargetReentersU1           = 0;
        TargetReentersU2           = 0;
        GodTimes       = 0;
        SpaceTimes     = 0;
        HTimes         = 0;
        User1TouchTime = 0;
        User2TouchTime = 0;
    }