Ejemplo n.º 1
0
 public void AddTrack(TrackData trackData)
 {
     //Check if TrackData with given tag already exists.
     if (CurrentTracks.Exists(x => x.Tag == trackData.Tag))
     {
         //Find index of existing data.
         int index = CurrentTracks.FindIndex(x => x.Tag == trackData.Tag);
         //replace existing data with new data.
         CurrentTracks[index] = trackData;
     }
     else
     {
         //Add trackData.
         CurrentTracks.Add(trackData);
     }
 }
Ejemplo n.º 2
0
        public void HandleNewTrackData(TrackData trackdata)
        {
            //Check if no track data with given tag exists.
            if (CurrentTracks.Exists(x => x.Tag == trackdata.Tag) == false)
            {
                // Add the new track if coordinates are inside the given boundaries of the airspace.
                if (_airspace.CheckIfInMonitoredArea(trackdata.CurrentXcord, trackdata.CurrentYcord,
                                                     trackdata.CurrentZcord))
                {
                    AddTrack(trackdata);
                    //string time = trackdata._TimeStamp;
                    //TrackEnteredEvent TrackEnteredEvent = new TrackEnteredEvent(time, trackdata, true, _outputConsole, _outputFile);
                    CurrentEvents.AddTrackEnteredEventFor(trackdata, _outputFile);
                }
            }
            else
            {
                //Update trackdata
                UpdateTrackData(trackdata);

                // Remove tracks if out of airspace
                CheckIfTrackdataIsStillInAirspace(trackdata);

                // Check for potential seperation events
                CheckForSeperationEvents(trackdata);
            }

            //Remove all events that are not relevant anymore
            CurrentEvents.cleanUpEvents();

            // Check for potential seperation events
            CheckForSeperationEvents(trackdata);

            // Update status of flightEvents' _isRaised-attribute.
            UpdateSeperationEventStatus();
        }