Esempio n. 1
0
    protected override void Logic()
    {
        switch (ExperimentID)
        {
        case null:
            ExperimentID = "ConditionTest";
            break;

        case "ConditionTest":
            if (SinceExReady > exsession.ReadyWait)
            {
                exmanager.uicontroller.IsGuideOn      = exsession.IsGuideOn;
                exmanager.uicontroller.FullScreen     = exsession.IsFullScreen;
                exmanager.uicontroller.IsFullViewport = exsession.IsFullViewport;
                EL.SetExParam("NotifyExperimenter", exsession.NotifyExperimenter);
                eye      = EL.GetExParam <Eye>("Eye");
                diameter = EL.GetEnvActiveParam <float>("Diameter");
                position = EL.GetEnvActiveParam <Vector3>("Position");

                ExperimentID = "Flash2Color";
            }
            break;

        case "Flash2Color":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    switch (ExRepeat)
                    {
                    case 0:
                        exmanager.uicontroller.FullViewportSize();
                        EL.SetExParam("Eye", eye);
                        EL.SetExParam("CondRepeat", 100);
                        EL.SetExParam("ColorSpace", "DKL");
                        EL.SetExParam("Color", "X");
                        break;

                    case 1:
                        EL.SetExParam("Color", "Y");
                        break;

                    case 2:
                        EL.SetExParam("Color", "Z");
                        break;
                    }
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    if (ExRepeat < 3)
                    {
                        ExperimentStatus = EXPERIMENTSTATUS.NONE;
                    }
                    else
                    {
                        ExperimentID = "Color";
                    }
                }
                break;
            }
            break;

        case "Color":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    switch (ExRepeat)
                    {
                    case 0:
                        EL.SetEnvActiveParam("Position", position);
                        EL.SetEnvActiveParam("Diameter", diameter);
                        EL.SetExParam("CondRepeat", 8);
                        EL.SetExParam("ColorSpace", "HSL");
                        EL.SetExParam("Color", "HueYm");
                        break;

                    case 1:
                        EL.SetExParam("ColorSpace", "DKL");
                        EL.SetExParam("Color", "HueL0");
                        break;
                    }
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    if (ExRepeat < 2)
                    {
                        ExperimentStatus = EXPERIMENTSTATUS.NONE;
                    }
                    else
                    {
                        ExperimentID = "HartleySubspace";
                    }
                }
                break;
            }
            break;

        case "HartleySubspace":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    switch (ExRepeat)
                    {
                    case 0:
                        EL.SetEnvActiveParam("Position", position);
                        EL.SetEnvActiveParam("Diameter", diameter);
                        EL.SetExParam("CondRepeat", 5);
                        EL.SetExParam("CondDur", 35.0.GetCondDur(Screen.currentResolution.refreshRate));
                        EL.SetExParam("ColorSpace", "DKL");
                        EL.SetExParam("Color", "X");
                        break;

                    case 1:
                        EL.SetExParam("ColorSpace", "LMS");
                        EL.SetExParam("Color", "Xmcc");
                        break;

                    case 2:
                        EL.SetExParam("Color", "Ymcc");
                        break;

                    case 3:
                        EL.SetExParam("Color", "Zmcc");
                        break;
                    }
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    if (ExRepeat < 4)
                    {
                        ExperimentStatus = EXPERIMENTSTATUS.NONE;
                    }
                    else
                    {
                        ExperimentID = "OriSF";
                    }
                }
                break;
            }
            break;

        case "OriSF":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    switch (ExRepeat)
                    {
                    case 0:
                        EL.SetEnvActiveParam("Position", position);
                        EL.SetEnvActiveParam("Diameter", diameter);
                        EL.SetExParam("CondRepeat", 6);
                        EL.SetEnvActiveParam("GratingType", "Sinusoidal");
                        EL.SetExParam("ColorSpace", "DKL");
                        EL.SetExParam("Color", "X");
                        break;

                    case 1:
                        EL.SetExParam("ColorSpace", "LMS");
                        EL.SetExParam("Color", "Xmcc");
                        break;

                    case 2:
                        EL.SetExParam("Color", "Ymcc");
                        break;

                    case 3:
                        EL.SetExParam("Color", "Zmcc");
                        break;
                    }
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    if (ExRepeat < 4)
                    {
                        ExperimentStatus = EXPERIMENTSTATUS.NONE;
                    }
                    else
                    {
                        StartStopExperimentSession(false);
                        exmanager.uicontroller.IsFullViewport = false;
                        exmanager.uicontroller.IsGuideOn      = true;
                        return;
                    }
                }
                break;
            }
            break;
        }
    }
Esempio n. 2
0
    protected override void Logic()
    {
        switch (ExperimentID)
        {
        case null:
            ExperimentID = "ConditionTest";
            break;

        case "ConditionTest":
            if (SinceExReady > exsession.ReadyWait)
            {
                exmanager.uicontroller.IsGuideOn      = exsession.IsGuideOn;
                exmanager.uicontroller.FullScreen     = exsession.IsFullScreen;
                exmanager.uicontroller.IsFullViewport = exsession.IsFullViewport;
                EL.SetExParam("NotifyExperimenter", exsession.NotifyExperimenter);
                diameter = EL.GetEnvActiveParam <float>("Diameter");

                ExperimentID = "RFBar4Deg";
            }
            break;

        case "RFBar4Deg":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    ExperimentID = "OriSFSquareGrating";
                }
                break;
            }
            break;

        case "OriSFSquareGrating":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    EL.SetEnvActiveParam("Diameter", diameter);
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    ExperimentID = "BOImage";
                }
                break;
            }
            break;

        case "BOImage":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    exmanager.uicontroller.ViewportSize();
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    ExperimentID = "DynamicAdelsonFast";
                }
                break;
            }
            break;

        case "DynamicAdelsonFast":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    exmanager.uicontroller.ViewportSize();
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    ExperimentID = "ContralAdelson";
                }
                break;
            }
            break;

        case "ContralAdelson":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    exmanager.uicontroller.ViewportSize();
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    ExperimentID = "StaticAdelson";
                }
                break;
            }
            break;

        case "StaticAdelson":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    exmanager.uicontroller.ViewportSize();
                    StartExperiment();
                }
                break;

            case EXPERIMENTSTATUS.STOPPED:
                if (SinceExStop > exsession.StopWait)
                {
                    StartStopExperimentSession(false);
                    exmanager.uicontroller.IsFullViewport = false;
                    exmanager.uicontroller.IsGuideOn      = true;
                    return;
                }
                break;
            }
            break;
        }
    }