public List <float> lightIntensities;      //holds tested light intensities, store test light intensities for future use, list length equals times tested

    public TestPoint(float xRotation, float yRotation, float stimuliRadius, List <float> lightInts)
    {
        angles           = new FloatAngle(xRotation, yRotation);
        radius           = stimuliRadius;
        lightIntensities = lightInts;
    }
示例#2
0
    TestPoint addStimuli()
    {
        FloatAngle newSti = new FloatAngle(0, 0);

        if (mode == TestMode.LaterGlaucoma)
        {
            float x = UnityEngine.Random.Range(-30.0f, 30.0f);
            float y = UnityEngine.Random.Range(-30.0f, 30.0f);

            if (x < 2f && x > 0f)
            {
                x += 2f;
            }
            if (y < 2f && y > 0f)
            {
                y += 2f;
            }
            if (x > -2f && x < 0f)
            {
                x -= 2f;
            }
            if (y > -2f && y < 0f)
            {
                y -= 2f;
            }
            newSti = new FloatAngle(x, y);
        }
        else if (mode == TestMode.EarlyGlaucoma)
        {
            float x = UnityEngine.Random.Range(-15.0f, 15.0f);
            float y = UnityEngine.Random.Range(-15.0f, 15.0f);
            if (x < 2f && x > 0f)
            {
                x += 2f;
            }
            if (y < 2f && y > 0f)
            {
                y += 2f;
            }
            if (x > -2f && x < 0f)
            {
                x -= 2f;
            }
            if (y > -2f && y < 0f)
            {
                y -= 2f;
            }
            if (x > 5f)
            {
                x += 5f;
            }
            if (y > 5f)
            {
                y += 5f;
            }
            if (x < -5f)
            {
                x -= 5f;
            }
            if (y < -5f)
            {
                y -= 5f;
            }
            newSti = new FloatAngle(x, y);
        }
        List <float> ints = new List <float>();

        ints.Add(startLightInt);
        TestPoint newPoint = new TestPoint(newSti.x, newSti.y, stimuliRadius, ints);

        return(newPoint);
    }