public void CheckPlanesInAirspace(List <IPlane> newplanes) { if (Planes.Count == 0) { foreach (var newplane in newplanes) { newplane.IsInAirspace = true; OnRaisedEnterEvent(new EnterEventArgs(newplane, newplane.TimeStamp.ToString())); ListOfTags.Add(newplane.Tag); } } else { foreach (var newPlane in newplanes) { if (ListOfTags.Contains(newPlane.Tag)) { newPlane.IsInAirspace = true; var plane = Planes.Find(x => x.Tag.Contains(newPlane.Tag)); _cc.CalcCourse(plane, newPlane); _cv.CalcVelocity(plane, newPlane); } else { newPlane.IsInAirspace = true; OnRaisedEnterEvent(new EnterEventArgs(newPlane, newPlane.TimeStamp.ToString())); ListOfTags.Add(newPlane.Tag); } } } Planes = newplanes; _rr.render(Planes); }
public void SortTracksInAirspace(List <Track> newTrackList) { for (int i = 0; i < newTrackList.Count; i++) { for (int j = 0; j < _currentTrackList.Count; j++) { if (newTrackList[i].Tag == _currentTrackList[j].Tag) { _calculateVelocity.CalcVelocity(_currentTrackList[j], newTrackList[i]); _calculateCourse.CalcCourse(_currentTrackList[j], newTrackList[i]); } } } _currentTrackList = newTrackList; foreach (var track in _currentTrackList) { _writer.WriteTrack(track); } _seperationTracks.SeperationCheck(_currentTrackList); }
public void CalcVelocity_Velocity_EqualTo40311Point29() { _uut.CalcVelocity(_track1, _track2); Assert.That(Math.Round(_tracks[1].Velocity, 2), Is.EqualTo(40311.29)); }
public void CV_fakePlane1_fakePlane2_IsNot900vel() { uut.CalcVelocity(fakePlane1, fakePlane2); Assert.That(fakePlane2.Velocity, Is.Not.EqualTo(900)); }