コード例 #1
0
        public void setup()
        {
            TrackListArgs = null;
            _uut          = new TransponderDataInterpreter();

            handler = Substitute.For <ITransponderReceiver>();
            //subscribe handler interpreter event
            _uut.subscribe(handler);


            //setup event listener
            _uut.TrackListEventHandler += (o, args) => { TrackListArgs = args; };
        }
コード例 #2
0
        static void setup()
        {
            tr            = TransponderReceiverFactory.CreateTransponderDataReceiver();
            TDInterpreter = new TransponderDataInterpreter();
            TDInterpreter.subscribe(tr);

            Position p = new Position();

            p.XCoordinate = 30000;
            p.YCoordinate = 30000;
            p.ZCoordinate = 5;

            airspace = new Airspace();
            airspace.AirspacePosition = p;
            airspace.HorizontalSize   = 100000;
            airspace.VerticalEnd      = 100000;

            ITrackListEvent itlEvent = TDInterpreter;

            validator = new ValidateTransponderData(ref itlEvent, airspace);

            AirOutputter = new AirTrafficOutputter();
            AirOutputter.TrafficController = new ConsoleAirTrafficController();
            List <IConditionStrategy <ITrack> > conditionStrategies = new List <IConditionStrategy <ITrack> >();

            conditionStrategies.Add(new TrackAltitudeCondition()
            {
                AltitudeRestriction = 100000
            });
            conditionStrategies.Add(new TrackHorizontalDistanceCondition()
            {
                HorizontalDistance = 100000
            });

            airCondDetector = new AirspaceTrackConditionDetector(conditionStrategies);

            TrackHorizontalDistanceCalculator HorizontalDistanceCalc = new TrackHorizontalDistanceCalculator();
            TrackSpeedCalculator  speedCalc  = new TrackSpeedCalculator(HorizontalDistanceCalc);
            TrackCourseCalculator courseCalc = new TrackCourseCalculator();
            AirspaceUpdater       airUpdater = new AirspaceUpdater(speedCalc, courseCalc);


            Monitor = new AirTrafficMonitor(validator, airCondDetector, AirOutputter, airUpdater);
            FileLogger fl = new FileLogger();

            fl.PathToFile       = "../../log.txt";
            AirOutputter.Logger = fl;
        }