Esempio n. 1
0
    public float GetTorque(WheelIndicator wheel)
    {
        switch (wheel)
        {
        case WheelIndicator.Left:
            return(leftDriver.Torque);

        case WheelIndicator.Right:
            return(rightDriver.Torque);

        default:
            throw new System.Exception("Unexpected default case while switching on " + wheel);
        }
    }
Esempio n. 2
0
    public static string ToShortString(this WheelIndicator self)
    {
        switch (self)
        {
        case WheelIndicator.Left:
            return("L");

        case WheelIndicator.Right:
            return("R");

        default:
            throw new System.Exception("Unexpected default case while switching on " + self);
        }
    }
Esempio n. 3
0
    public void SetPower(WheelIndicator wheel, float power)
    {
        assertPercent(power);
        switch (wheel)
        {
        case WheelIndicator.Left:
            leftDriver.Power = power;
            break;

        case WheelIndicator.Right:
            rightDriver.Power = power;
            break;

        default:
            throw new System.Exception("Unexpected default case while switching on " + wheel);
        }
    }
Esempio n. 4
0
    public void SetThrottled(WheelIndicator wheel, bool throttled)
    {
        switch (wheel)
        {
        case WheelIndicator.Left:
            if (throttled != leftDriver.Throttled)
            {
                leftDriver.Throttled        = throttled;
                leftDriver.ThrottledChanged = true;
            }
            break;

        case WheelIndicator.Right:
            if (throttled != rightDriver.Throttled)
            {
                rightDriver.Throttled        = throttled;
                rightDriver.ThrottledChanged = true;
            }
            break;

        default:
            throw new System.Exception("Unexpected default case while switching on " + wheel);
        }
    }