Пример #1
0
        private void OnFlightTracksUpdated(object o, MultipleFlightTracksUpdatedEventArgs args)
        {
            List <IFlightTrackerSingle> allUpdatedFlights = args.UpdatedFlights;

            Content.Clear();

            foreach (var f in allUpdatedFlights)
            {
                if (IsInsideAirspace(f.GetNewestDataPoint(), AirspaceArea))
                {
                    Content.Add(f);
                }
            }

            if (Content.Count == 0)//Should be in monitor
            {
            }
            else
            {
                Console.WriteLine("-------------------Airspace Currently Contains:------------------ ");
                foreach (var f in Content)
                {
                    FTDataPoint dp = f.GetNewestDataPoint();
                    Console.WriteLine("Flight - Tag: " + dp.Tag + " Pos: " + dp.X + "," + dp.Y + Environment.NewLine + "         Altitude: " + dp.Altitude + " Velocity: " + f.GetCurrentVelocity() + " Course: " + f.GetCurrentCourse());
                }
            }


            AirspaceContentUpdated?.Invoke(this, new AirspaceContentEventArgs(Content));
        }
Пример #2
0
        private void OnFlightTracksUpdated(object o, FlightTracksUpdatedEventArgs args)
        {
            List <IFlightTrack> allUpdatedFlights = args.UpdatedFlights;

            _content.Clear();

            foreach (var f in allUpdatedFlights)
            {
                var pos = f.GetCurrentPosition();
                if (_airspaceArea.IsInside((int)pos.X, (int)pos.Y, (int)f.GetCurrentAltitude()))
                {
                    _content.Add(f);
                }
            }

            FlightTracksUpdated?.Invoke(this, new FlightTracksUpdatedEventArgs(_content));
            AirspaceContentUpdated?.Invoke(this, new AirspaceContentEventArgs(_content));
        }