Beispiel #1
0
 public void Edit(LedAnimation pAnimation)
 {
     this.textColor.Enabled = formMain.GetColorComboBoxEnable(true);
     this.backColor.Enabled = formMain.GetColorComboBoxEnable(true);
     this.animation         = pAnimation;
     this.LoadParam();
 }
Beispiel #2
0
		public void MakeAnimation(LedAnimation pAnimation)
		{
			if (pAnimation.Changed)
			{
				formAnimationMaker formAnimationMaker = new formAnimationMaker();
				formAnimationMaker.Make(pAnimation.GetSize(), pAnimation);
				pAnimation.Changed = false;
				formAnimationMaker.Dispose();
			}
		}
Beispiel #3
0
        protected LedAnimation GetLedAnimation(string index)
        {
            string value;

            if (_settings.Items.TryGetValue(FullKey(index), out value))
            {
                return(LedAnimation.Parse(value));
            }
            return(default(LedAnimation));
        }
Beispiel #4
0
 public AnimationMaker(System.Drawing.Size pSize, LedAnimation pAnimation)
 {
     this.InitializeComponent();
     pAnimation.EAnimation.PageCount = 0;
     base.Size        = pSize;
     this.displaySize = pSize;
     this.animation   = pAnimation;
     this.Wpr         = new AnimationMaker.FlaWndProc(this.EFFWndProc);
     this.OldWndProc  = AnimationMaker.SetWindowLong(this.player.Handle, -4, this.Wpr);
     this.ChangeEffect();
 }
Beispiel #5
0
		private void GetAnimationAndBackground(LedPanel _this_Panel)
		{
			for (int i = 0; i < _this_Panel.Items.Count; i++)
			{
				LedItem ledItem = _this_Panel.Items[i];
				if (ledItem.Background.Enabled)
				{
					this.MakeAnimation(new System.Drawing.Size(_this_Panel.Width, _this_Panel.Height), ledItem.Background);
				}
				for (int j = 0; j < ledItem.Subareas.Count; j++)
				{
					LedSubarea ledSubarea = ledItem.Subareas[j];
					if (ledSubarea.Type == LedSubareaType.Animation)
					{
						LedAnimation ledAnimation = (LedAnimation)ledSubarea.SelectedContent;
						this.MakeAnimation(ledAnimation);
						if (ledAnimation.Background.Enabled)
						{
							this.MakeAnimation(ledSubarea.Size, ledAnimation.Background);
						}
					}
					else if (ledSubarea.Type == LedSubareaType.PictureText)
					{
						for (int k = 0; k < ledSubarea.Contents.Count; k++)
						{
							LedPictureText ledPictureText = (LedPictureText)ledSubarea.Contents[k];
							if (ledPictureText.PictureTextType == LedPictureTextType.Animation)
							{
								this.MakeAnimation((LedAnimation)ledPictureText);
							}
							if (ledPictureText.Background.Enabled)
							{
								this.MakeAnimation(ledSubarea.Size, ledPictureText.Background);
							}
						}
					}
					else if (ledSubarea.Type == LedSubareaType.Subtitle)
					{
						LedDText ledDText = (LedDText)ledSubarea.SelectedContent;
						if (ledDText.Background.Enabled)
						{
							this.MakeAnimation(ledSubarea.Size, ledDText.Background);
						}
					}
					else if (ledSubarea.SelectedContent.Background.Enabled)
					{
						this.MakeAnimation(ledSubarea.Size, ledSubarea.SelectedContent.Background);
					}
				}
			}
		}
Beispiel #6
0
        public void Edit(System.Drawing.Size pSize, LedAnimation pAnimation)
        {
            this.animationMaker = new AnimationMaker(pSize, pAnimation);
            int x = (this.panel1.Width - this.animationMaker.Width) / 2;
            int y = (this.panel1.Height - this.animationMaker.Height) / 2;

            this.animationMaker.Location = new System.Drawing.Point(x, y);
            this.animationMaker.Parent   = this.panel1;
            this.animation = pAnimation;
            this.panelSize = pSize;
            this.animationEditor1.Edit(pAnimation);
            this.animationEditor1.AllwaysPreview();
            this.animationEffect1.Edit(pAnimation);
            base.ShowDialog();
        }
Beispiel #7
0
        public void Make(System.Drawing.Size pSize, LedAnimation pAnimation)
        {
            int num  = base.Size.Width - this.panel1.Width;
            int num2 = base.Size.Height - this.panel1.Height;

            this.man             = pAnimation;
            this.timer1.Interval = 1000 / formAnimationMaker.FrameRate;
            this.am = new AnimationMaker(pSize, pAnimation);
            this.am.ChangeEffect();
            this.am.Size   = pSize;
            this.am.Dock   = DockStyle.Fill;
            this.am.Event += new AnimationEvent(this.am_Event);
            this.panel1.Controls.Add(this.am);
            this.am.Location = new System.Drawing.Point(0, 0);
            this.timer1.Start();
            base.Size        = new System.Drawing.Size(pSize.Width + num, pSize.Height + num2);
            this.am.Location = new System.Drawing.Point(0, 0);
            base.ShowDialog();
            this.CantClose();
        }
Beispiel #8
0
        private void button9_Click(object sender, RoutedEventArgs e)
        {
            LedAnimation animation   = ARDrone.Control.Commands.LedAnimation.BLANK;
            int          miliseconds = Convert.ToInt16(LedDuration.Text.ToString());
            int          frequency   = Convert.ToInt16(LedFrequency.Text.ToString());

            switch (LedAnimationComboBox.SelectedIndex)
            {
            case 0: animation = ARDrone.Control.Commands.LedAnimation.BLINK_GREEN_RED; break;

            case 1: animation = ARDrone.Control.Commands.LedAnimation.BLINK_GREEN; break;

            case 2: animation = ARDrone.Control.Commands.LedAnimation.BLINK_RED; break;

            case 3: animation = ARDrone.Control.Commands.LedAnimation.BLINK_ORANGE; break;

            case 4: animation = ARDrone.Control.Commands.LedAnimation.SNAKE_GREEN_RED; break;

            case 5: animation = ARDrone.Control.Commands.LedAnimation.FIRE; break;

            case 6: animation = ARDrone.Control.Commands.LedAnimation.STANDARD; break;

            case 7: animation = ARDrone.Control.Commands.LedAnimation.RED; break;

            case 8: animation = ARDrone.Control.Commands.LedAnimation.GREEN; break;

            case 9: animation = ARDrone.Control.Commands.LedAnimation.RED_SNAKE; break;

            case 10: animation = ARDrone.Control.Commands.LedAnimation.BLANK; break;

            case 11: animation = ARDrone.Control.Commands.LedAnimation.LEFT_GREEN_RIGHT_RED; break;

            case 12: animation = ARDrone.Control.Commands.LedAnimation.LEFT_RED_RIGHT_GREEN; break;

            case 13: animation = ARDrone.Control.Commands.LedAnimation.BLINK_STANDARD; break;
            }

            Command DroneAnimationCommand = new PlayLedAnimationCommand(animation, frequency, miliseconds);

            droneControl.SendCommand(DroneAnimationCommand);
        }
 public LedSubareaDisplayHolder(LedSubarea pSubarea)
 {
     this.InitializeComponent();
     this.ledSub = pSubarea;
     this.ledSub.LoadFromFile();
     if (pSubarea.Type == LedSubareaType.Subtitle)
     {
         this.isMarquee = true;
         LedDText arg_39_0 = (LedDText)pSubarea.SelectedContent;
         this.timer_Text.Start();
     }
     else if (pSubarea.Type == LedSubareaType.PictureText)
     {
         this.isMarquee = true;
         this.timer_Marquee.Start();
     }
     else if (pSubarea.Type == LedSubareaType.Animation)
     {
         this.isMarquee    = true;
         this.isAnimation  = true;
         this.ledAnimation = (LedAnimation)pSubarea.SelectedContent;
         this.timer_Marquee.Start();
     }
     else
     {
         pSubarea.SelectedContent.LastDrawn = null;
         this.isMarquee           = false;
         this.timer_Draw.Interval = 1000;
         this.timer_Draw.Start();
     }
     if (pSubarea.SelectedContent != null && pSubarea.SelectedContent.Edge.Enabled && !this.isMarquee)
     {
         this.edgeDis = new EdgeDisplay(pSubarea.SelectedContent.Edge, pSubarea);
         this.timer_edge.Start();
     }
 }
 internal static void PlayLedAnimation(LedAnimation ledAnimation, int frequency, int duration)
 {
     int newFrequency;
     newFrequency = BitConverter.ToInt32(BitConverter.GetBytes((float)frequency), 0);
     EnqueueCommand(ATCommands.PlayLedAnimation, (int)ledAnimation, newFrequency, duration);
 }
Beispiel #11
0
 protected void Set(string index, LedAnimation value)
 {
     Set(index, value.ToString());
 }
 public PlayLedAnimationCommand(LedAnimation ledAnimation, int frequency, int duration)
 {
     this.ledAnimation = ledAnimation;
     this.frequency    = frequency;
     this.duration     = duration;
 }
 public PlayLedAnimationCommand(LedAnimation ledAnimation, int frequency, int duration)
 {
     this.ledAnimation = ledAnimation;
     this.frequency = frequency;
     this.duration = duration;
 }
Beispiel #14
0
 private void StartRedraw()
 {
     do
     {
         this.DrawNum = 0;
         int num = 0;
         if (this.subarea.SelectedContent != null)
         {
             num = this.subarea.SelectedContent.GetActualWidth();
         }
         if (num > 0 && this.subarea.Width < num)
         {
             this.subarea.Width = num;
         }
         int num2 = 0;
         if (this.subarea.ParentItem != null && this.subarea.ParentItem.Edge != null)
         {
             num2 = (this.subarea.ParentItem.Edge.Enabled ? this.subarea.ParentItem.Edge.Height : 0);
         }
         if (this.subarea.SelectedContent != null && this.subarea.SelectedContent.Edge != null && this.subarea.SelectedContent.Edge.Enabled)
         {
             int arg_E1_0 = this.subarea.SelectedContent.Edge.Height;
         }
         if (this.subarea.Width > this.subarea.ParentItem.ParentPanel.Width - num2 * 2)
         {
             this.subarea.Width = this.subarea.ParentItem.ParentPanel.Width - num2 * 2;
         }
         if (this.subarea.Width + this.subarea.X > this.subarea.ParentItem.ParentPanel.Width - num2 * 2)
         {
             this.subarea.X = this.subarea.ParentItem.ParentPanel.Width - num2 * 2 - this.subarea.Width;
         }
         this.ResetHolderPosition();
         try
         {
             this.subarea.Draw();
         }
         catch
         {
         }
     }while (this.DrawNum > 0);
     this.DrawFinished           = true;
     this.subarea.LastScaleDrawn = LedGraphics.ScaleAndGrid(this.subarea.LastDrawn, formMain.ledsys.SelectedPanel.Zoom);
     if (this.subarea.LastScaleDrawn != null && this.subarea.LastScaleDrawn.PixelFormat != System.Drawing.Imaging.PixelFormat.Undefined)
     {
         System.Drawing.Bitmap bitmap = (System.Drawing.Bitmap) this.subarea.LastScaleDrawn.Clone();
         if (this.isActivated)
         {
             this.DrawControlPoint(bitmap);
         }
         formMain.ReleasePicture(this.picSubarea, bitmap);
         bitmap.Dispose();
     }
     if (this.subarea.Type == LedSubareaType.Animation)
     {
         LedAnimation ledAnimation = (LedAnimation)this.subarea.SelectedContent;
         ledAnimation.Changed = true;
         return;
     }
     if (this.subarea.Type == LedSubareaType.PictureText && this.subarea.SelectedContent != null)
     {
         LedPictureText ledPictureText = (LedPictureText)this.subarea.SelectedContent;
         if (ledPictureText.PictureTextType == LedPictureTextType.Animation)
         {
             ((LedAnimation)ledPictureText).Changed = true;
         }
     }
 }
Beispiel #15
0
 public void Edit(LedAnimation pAnimation)
 {
     this.animation = pAnimation;
     this.LoadParam();
 }
 /// <summary>
 /// Makes the ARDrone animate its LED's.
 /// </summary>
 /// <param name="ledAnimation">The animation to play.</param>
 /// <param name="frequency">The blink frequency of the animation in times per second (Hz).</param>
 /// <param name="duration">The duration of the animation in seconds.</param>
 public void PlayLedAnimation(LedAnimation ledAnimation, int frequency, int duration)
 {
     CommandCenter.PlayLedAnimation(ledAnimation, frequency, duration);
 }
Beispiel #17
0
 private void formAnimation_FormClosing(object sender, FormClosingEventArgs e)
 {
     this.StopPreview();
     this.animation = null;
 }