Beispiel #1
0
 public FlightAnimationItem Set(FlightAnimation animation, int duration)
 {
     Animation = animation;
     Duration  = duration;
     Value     = string.Format("{0},{1}", (int)Animation, Duration);
     return(this);
 }
Beispiel #2
0
        protected FlightAnimation GetFlightAnimation(string index)
        {
            string value;

            if (_settings.Items.TryGetValue(FullKey(index), out value))
            {
                return(FlightAnimation.Parse(value));
            }
            return(default(FlightAnimation));
        }
Beispiel #3
0
 public static FlightAnimation Parse(string value)
 {
     string[] parts = value.Split(',');
     var animation = new FlightAnimation();
     FlightAnimationType type;
     int duration;
     if (parts.Length > 1 && Enum.TryParse(parts[0], out type) && int.TryParse(parts[1], out duration))
     {
         animation.Type = type;
         animation.Duration = duration;
     }
     return animation;
 }
Beispiel #4
0
        public static FlightAnimation Parse(string value)
        {
            string[]            parts     = value.Split(',');
            var                 animation = new FlightAnimation();
            FlightAnimationType type;
            int                 duration;

            if (parts.Length > 1 && EnumHelper.TryParseEnum(parts[0], out type) && int.TryParse(parts[1], out duration))
            {
                animation.Type     = type;
                animation.Duration = duration;
            }
            return(animation);
        }
Beispiel #5
0
 protected void Set(string index, FlightAnimation value)
 {
     Set(index, value.ToString());
 }
Beispiel #6
0
        public static int GetDefaultDuration(FlightAnimation animation)
        {
            switch (animation)
            {
            case FlightAnimation.PhiM30Deg:
                return(1000);

            case FlightAnimation.Phi30Deg:
                return(1000);

            case FlightAnimation.ThetaM30Deg:
                return(1000);

            case FlightAnimation.Theta30Deg:
                return(1000);

            case FlightAnimation.Theta20DegYaw200Deg:
                return(1000);

            case FlightAnimation.Theta20DegYawM200Deg:
                return(1000);

            case FlightAnimation.Turnaround:
                return(5000);

            case FlightAnimation.TurnaroundGodown:
                return(5000);

            case FlightAnimation.YawShake:
                return(2000);

            case FlightAnimation.YawDance:
                return(5000);

            case FlightAnimation.PhiDance:
                return(5000);

            case FlightAnimation.ThetaDance:
                return(5000);

            case FlightAnimation.VzDance:
                return(5000);

            case FlightAnimation.Wave:
                return(5000);

            case FlightAnimation.PhiThetaMixed:
                return(5000);

            case FlightAnimation.DoublePhiThetaMixed:
                return(5000);

            case FlightAnimation.FlipAhead:
                return(15);

            case FlightAnimation.FlipBehind:
                return(15);

            case FlightAnimation.FlipLeft:
                return(15);

            case FlightAnimation.FlipRight:
                return(15);

            case FlightAnimation.Mayday:
                return(15);

            default:
                throw new ArgumentOutOfRangeException("animation");
            }
        }
Beispiel #7
0
 public FlightAnimationItem Set(FlightAnimation animation)
 {
     return(Set(animation, GetDefaultDuration(animation)));
 }