public AirTrafficMonitor(IAirTrafficMonitorFactory factory, ITransponderReceiver receiver)
        {
            _separationService = factory.SeparationService;
            _trackingService   = factory.TrackingService;
            _airspaceService   = factory.AirspaceService;
            _airspace          = factory.Airspace;

            //Subscribe to events.
            receiver.TransponderDataReady += TransponderReceiver_DataReady;

            //Initialize
            _trackings        = new HashSet <ITrack>();
            _separationEvents = new HashSet <ISeparationEvent>();
        }
Beispiel #2
0
        public void Setup()
        {
            _airspaceService = new AirspaceService();

            // An airspace consisting of a cube measuring 11x11x11 is constructed. The southwest corner is placed in (0,0)
            // The airspace is constructed in such a way that a x, y or z value of 5 is considered a "safe" value
            // because such a value is placed in the middle of the airspace
            var southWestCoordinate = Substitute.For <ITwoDimensionalCoordinate>();

            southWestCoordinate.X.Returns(0);
            southWestCoordinate.Y.Returns(0);

            var northEastCoordinate = Substitute.For <ITwoDimensionalCoordinate>();

            northEastCoordinate.X.Returns(10);
            northEastCoordinate.Y.Returns(10);

            _airspace = Substitute.For <IAirspace>();
            _airspace.LowerAltitudeBoundary.Returns(0);
            _airspace.UpperAltitudeBoundary.Returns(10);
            _airspace.SouthWestCorner.Returns(southWestCoordinate);
            _airspace.NorthEastCorner.Returns(northEastCoordinate);
        }