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); }
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); } }
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(); } }