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"); }
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"); } }
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; }
public FlightAnimation(FlightAnimationType type, int duration) : this() { Type = type; Duration = duration; }
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"); } }
public FlightAnimation(FlightAnimationType type) : this(type, GetDefaultDuration(type)) { }
private void FlightAnimationCB_SelectionChanged(object sender, SelectionChangedEventArgs e) { FlightAnimationType selectedAnimation = (FlightAnimationType)Enum.Parse(typeof(FlightAnimationType), FlightAnimationCB.SelectedItem.ToString(), false); droneController.flightAnimationType = selectedAnimation; }
private void FlightAnimation(FlightAnimationType flightAnimationType) { settings.Control.FlightAnimation = new FlightAnimation(flightAnimationType); _client.Send(settings); // throw new NotImplementedException(); }