Beispiel #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;
        }
    }
Beispiel #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);
                eye = EL.GetExParam <Eye>("Eye");

                ExperimentID = "ISICycleOri";
            }
            break;

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

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

        case "ISIEpochOri8":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    switch (ExRepeat)
                    {
                    case 0:
                        EL.SetExParam("ColorSpace", "DKL");
                        EL.SetExParam("Color", "X");
                        exmanager.uicontroller.FullViewportSize();
                        break;
                    }
                    StartExperiment();
                }
                break;

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

        case "ISICycle2Color":
            switch (ExperimentStatus)
            {
            case EXPERIMENTSTATUS.NONE:
                if (SinceExReady > exsession.ReadyWait)
                {
                    switch (ExRepeat)
                    {
                    case 0:
                        EL.SetExParam("ColorSpace", "DKL");
                        EL.SetExParam("Color", "X");
                        EL.SetExParam("ModulateParam", "ModulateTime");
                        EL.SetExParam("CycleDirection", 1f);
                        exmanager.uicontroller.FullViewportSize();
                        EL.SetEnvActiveParam("GratingType", "Sinusoidal");
                        EL.SetEnvActiveParam("ModulateGratingType", "Sinusoidal");
                        EL.SetEnvActiveParam("SpatialPhase", 0.75);
                        break;

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

                    case 2:
                        EL.SetExParam("ColorSpace", "LMS");
                        EL.SetExParam("Color", "Y");
                        break;

                    case 3:
                        EL.SetExParam("ColorSpace", "LMS");
                        EL.SetExParam("Color", "Z");
                        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;
                    }
                }
                break;
            }
            break;
        }
    }