Exemplo n.º 1
0
 private static void DoCommonPedalOperationsWithLightsChangesInTheMiddle(CabinService cabinService)
 {
     cabinService.ApplyGasPedalPressure(new PedalPressure(0.15));
     TimeHelper.WaitSeconds(3);
     cabinService.ApplyGasPedalPressure(new PedalPressure(0.35));
     TimeHelper.WaitSeconds(3);
     cabinService.ApplyGasPedalPressure(new PedalPressure(0.55));
     TimeHelper.WaitSeconds(3);
     _externalSystems.getLights().setLightsPosition(3);
     cabinService.ApplyGasPedalPressure(new PedalPressure(0.75));
     TimeHelper.WaitSeconds(5);
     cabinService.ApplyGasPedalPressure(new PedalPressure(0.55));
     TimeHelper.WaitSeconds(3);
     _externalSystems.getLights().setLightsPosition(5);
     cabinService.ApplyGasPedalPressure(new PedalPressure(0.35));
     TimeHelper.WaitSeconds(3);
     cabinService.ApplyGasPedalPressure(new PedalPressure(0));
     TimeHelper.WaitSeconds(3);
     cabinService.ApplyBrakePedalPressure(new PedalPressure(0.5));
     TimeHelper.WaitSeconds(5);
 }
        public TiltPosition GetTiltPosition()
        {
            var lightsPosition = _externalSystems.getLights()?.getLightsPosition();

            if (lightsPosition == null)
            {
                throw new Exception("No option in vehicle.");
            }

            if (lightsPosition >= 1 && lightsPosition <= 3)
            {
                return(TiltPosition.Downwards);
            }
            else if (lightsPosition >= 7 && lightsPosition <= 10)
            {
                return(TiltPosition.Upwards);
            }
            else
            {
                return(TiltPosition.Balanced);
            }
        }