Esempio n. 1
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;
        }
 public void TestSetup()
 {
     _courseCalculator   = Substitute.For <ITrackCalculator <double> >();
     _speedCalculator    = Substitute.For <ITrackCalculator <double> >();
     _uutAirspaceUpdater = new AirspaceUpdater(_speedCalculator, _courseCalculator);
 }