Exemplo n.º 1
0
        public void CheckSeperation_NotInAirSpaceAndSameTag_Empty()
        {
            bool called = false;
            var  track  = new Track("Tag;0;0;0;00010101010101001");
            var  list   = new List <ITrack>();

            list.Add(track);
            _uut.SeperationEvent += (o, e) => called = true;
            _uut.CheckSeperation(list, track);
            Assert.IsFalse(called);
        }
Exemplo n.º 2
0
        private void Update()
        {
            var tracks = TrackRepository.GetAll().ToList();
            var seperationAlerts = SeperationAlertRepository.GetAll();

            var list = seperationAlerts.Select(alerts => tracks.FirstOrDefault(o => o.Tag == alerts.Tag1)).ToList();

            var toRemove = Seperation.CheckSeperation(list).ToList();

            if (!toRemove.Any()) return;

            foreach (var track in toRemove)
            {
                SeperationAlertRepository.Remove(track.Item1, track.Item2);
            }
        }
Exemplo n.º 3
0
        public void ReceiverOnTransponderDataReady(object sender, RawTransponderDataEventArgs rawTransponderDataEventArgs)
        {
            Update();

            foreach (var v in rawTransponderDataEventArgs.TransponderData)
            {
                TrackRepository.Add(v);
            }

            foreach (var t in TrackRepository.GetAll())
            {
                t.IsInAirspace = AirSpace.CheckAirSpace(t.Vector);
                Seperation.CheckSeperation(TrackRepository.FlightTracks.ToList(), t);
            }

            if (ConsoleOut)
            {
                Display();
            }
        }