예제 #1
0
        public async void PlayAnimation(FlightAnimationType animationType)
        {
            // 6000 = infinity : need to be tuned for some type of animations
            _configuration.Control.FlightAnimation = new FlightAnimation(animationType, 6000);
            await SendConfiguration();

            await Log.Instance.WriteLineAsync("DroneClient:PlayAnimation");

            SendMessageToUI("Animation executed successfully");
        }
예제 #2
0
 public static int GetDefaultDuration(FlightAnimationType type)
 {
     switch (type)
     {
         case FlightAnimationType.PhiM30Deg:
             return 1000;
         case FlightAnimationType.Phi30Deg:
             return 1000;
         case FlightAnimationType.ThetaM30Deg:
             return 1000;
         case FlightAnimationType.Theta30Deg:
             return 1000;
         case FlightAnimationType.Theta20DegYaw200Deg:
             return 1000;
         case FlightAnimationType.Theta20DegYawM200Deg:
             return 1000;
         case FlightAnimationType.Turnaround:
             return 5000;
         case FlightAnimationType.TurnaroundGodown:
             return 5000;
         case FlightAnimationType.YawShake:
             return 2000;
         case FlightAnimationType.YawDance:
             return 5000;
         case FlightAnimationType.PhiDance:
             return 5000;
         case FlightAnimationType.ThetaDance:
             return 5000;
         case FlightAnimationType.VzDance:
             return 5000;
         case FlightAnimationType.Wave:
             return 5000;
         case FlightAnimationType.PhiThetaMixed:
             return 5000;
         case FlightAnimationType.DoublePhiThetaMixed:
             return 5000;
         case FlightAnimationType.FlipAhead:
             return 15;
         case FlightAnimationType.FlipBehind:
             return 15;
         case FlightAnimationType.FlipLeft:
             return 15;
         case FlightAnimationType.FlipRight:
             return 15;
         case FlightAnimationType.Mayday:
             return 15;
         default:
             throw new ArgumentOutOfRangeException("type");
     }
 }
예제 #3
0
        private void initAnimationComponent()
        {
            LedAnimationCB.ItemsSource = System.Enum.GetNames(typeof(LedAnimationType));
            LedAnimationType defaultLedType = LedAnimationType.BlinkGreenRed;

            LedAnimationCB.SelectedItem      = defaultLedType.ToString();
            LedAnimationCB.IsEnabled         = false;
            droneController.ledAnimationType = defaultLedType;
            droneController.isLedEnable      = false;

            FlightAnimationCB.ItemsSource = System.Enum.GetNames(typeof(FlightAnimationType));
            FlightAnimationType defaultFlightType = FlightAnimationType.FlipRight;

            FlightAnimationCB.SelectedItem      = defaultFlightType.ToString();
            FlightAnimationCB.IsEnabled         = false;
            droneController.flightAnimationType = defaultFlightType;
            droneController.isFlightEnable      = false;
        }
예제 #4
0
 public FlightAnimation(FlightAnimationType type, int duration)
     : this()
 {
     Type     = type;
     Duration = duration;
 }
예제 #5
0
        public static int GetDefaultDuration(FlightAnimationType type)
        {
            switch (type)
            {
            case FlightAnimationType.PhiM30Deg:
                return(1000);

            case FlightAnimationType.Phi30Deg:
                return(1000);

            case FlightAnimationType.ThetaM30Deg:
                return(1000);

            case FlightAnimationType.Theta30Deg:
                return(1000);

            case FlightAnimationType.Theta20DegYaw200Deg:
                return(1000);

            case FlightAnimationType.Theta20DegYawM200Deg:
                return(1000);

            case FlightAnimationType.Turnaround:
                return(5000);

            case FlightAnimationType.TurnaroundGodown:
                return(5000);

            case FlightAnimationType.YawShake:
                return(2000);

            case FlightAnimationType.YawDance:
                return(5000);

            case FlightAnimationType.PhiDance:
                return(5000);

            case FlightAnimationType.ThetaDance:
                return(5000);

            case FlightAnimationType.VzDance:
                return(5000);

            case FlightAnimationType.Wave:
                return(5000);

            case FlightAnimationType.PhiThetaMixed:
                return(5000);

            case FlightAnimationType.DoublePhiThetaMixed:
                return(5000);

            case FlightAnimationType.FlipAhead:
                return(15);

            case FlightAnimationType.FlipBehind:
                return(15);

            case FlightAnimationType.FlipLeft:
                return(15);

            case FlightAnimationType.FlipRight:
                return(15);

            case FlightAnimationType.Mayday:
                return(15);

            default:
                throw new ArgumentOutOfRangeException("type");
            }
        }
예제 #6
0
 public FlightAnimation(FlightAnimationType type)
     : this(type, GetDefaultDuration(type))
 {
 }
예제 #7
0
파일: DroneClient.cs 프로젝트: Eggies/SDK
        public async void PlayAnimation(FlightAnimationType animationType)
        {
            // 6000 = infinity : need to be tuned for some type of animations          
            _configuration.Control.FlightAnimation = new FlightAnimation(animationType, 6000);
            await SendConfiguration();

            await Log.Instance.WriteLineAsync("DroneClient:PlayAnimation");
            SendMessageToUI("Animation executed successfully");
        }
예제 #8
0
 public FlightAnimation(FlightAnimationType type, int duration)
     : this()
 {
     Type = type;
     Duration = duration;
 }
예제 #9
0
 public FlightAnimation(FlightAnimationType type)
     : this(type, GetDefaultDuration(type))
 {
 }
예제 #10
0
        private void FlightAnimationCB_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            FlightAnimationType selectedAnimation = (FlightAnimationType)Enum.Parse(typeof(FlightAnimationType), FlightAnimationCB.SelectedItem.ToString(), false);

            droneController.flightAnimationType = selectedAnimation;
        }
예제 #11
0
 private void FlightAnimation(FlightAnimationType flightAnimationType)
 {
     settings.Control.FlightAnimation = new FlightAnimation(flightAnimationType);
     _client.Send(settings);
     // throw new NotImplementedException();
 }