Exemple #1
0
        private void PlotPanel_Paint(object sender, PaintEventArgs e)
        {
            var g = new GraphicsAdapter(e.Graphics);

            Logger.Info($"Paint: {e.ClipRectangle}");
            RadarReceiver.Draw(g);
        }
Exemple #2
0
        /// <summary>
        /// Method used to add a contact by absolute position
        /// </summary>
        /// <param name="position">Absolute position of contact <see cref="PointF"/></param>
        /// <param name="contactType">Contact type to create <see cref="ContactTypes"/></param>
        /// <param name="heading"></param>
        /// <param name="speed"></param>
        /// <param name="altitude"></param>
        /// <returns></returns>
        protected IReferencePoint CreateContactAtPoint(PointF position, ContactTypes contactType, double heading = 0.00, double speed = 0.00, double altitude = 0.00)
        {
            var contactFactory = new ContactCreator();
            var newContact     = contactFactory.Create(RadarReceiver, position, heading, altitude, speed, contactType);

            Logger.Info($"Creating contact: {contactType} as a plotted contact at {position}");
            newContact.ReferencePointChanged += NewContact_ReferencePointChanged;
            RadarReceiver.AddContact(newContact);
            newContact.Start();
            return(newContact);
        }
Exemple #3
0
 private void PlotPanel_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         var absolutePosition = new Point(e.X, e.Y);
         RadarReceiver
         .FindContact(absolutePosition, new Size(5, 5), CoordinateConverter.ROUND_DIGITS)
         .ForEach(contact =>
         {
             contact.Selected = !contact.Selected;
         });
     }
 }