public void OnRawData(object o, RawTransponderDataEventArgs args)
        {
            _tempTrackList.Clear();
            //Saves old data from _trackList into _tempTrackList
            _tempTrackList = _trackList.GetRange(0, _trackList.Count);
            _trackList.Clear();

            //Adds and converts new flight(s)
            foreach (var track in args.TransponderData)
            {
                var td = _track.Convert(track);

                //Validates if it's in our area
                if (_trackValidation.ValidateTrack(td.X, td.Y, td.Altitude))
                {
                    //Forloop to check if the old list, _tempTrackList, holds any data about the flight
                    for (int i = 0; i < _tempTrackList.Count; i++)
                    {
                        if (_tempTrackList[i].Tag.Equals(td.Tag, StringComparison.OrdinalIgnoreCase))
                        {
                            //If it holds any data about the flight, calculate veocity and course
                            _calculateVelocity.CalVelocity(_tempTrackList[i], td);
                            _calculateCourse.CalCourse(_tempTrackList[i], td);
                        }
                    }
                    //Adds flight to _trackList
                    _trackList.Add(td);
                }
            }

            _trackSeperation.CheckForSeperation(_trackList);
            //Prints all tracks in _trackList
            _outputTrackReceiver.ReceiveTracks(_trackList);
        }
Example #2
0
 public void CheckForSeperation_True()
 {
     _uut.CheckForSeperation();
 }