Esempio n. 1
0
        private static void FillPlanes()
        {
            Aircraft    testAirplane         = new Aircraft(new AircraftIdData("K7H570BG", "Boeing 737", "Ninja Air", true), 200);
            Airport     testDepartureAirport = new Airport("John F. Kennedy International Airport", new Position3D(-90.9187999m, 46.5482781m, 251), new Person("John Kennedy"));
            Airport     testArrivalAirport   = new Airport("Saranak Lake Airport", new Position3D(-74.1m, 44.2m, 251), new Person("Whinston Churchill"));
            AirspaceFix firstFix             = new AirspaceFix(new Position3D(-87.9187999m, 44.5482781m, 251), false, false);
            AirspaceFix secondFix            = new AirspaceFix(new Position3D(-84.9187999m, 45.5482781m, 251), false, false);
            FlightRoute testRoute            = new FlightRoute();

            testRoute.AddFix(firstFix);
            testRoute.AddFix(secondFix);
            FlightPlan testFlightPlan = new FlightPlan(testDepartureAirport, testArrivalAirport, DateTime.Now, DateTime.Now.AddMinutes(30), 200, testRoute, 10000, FlightType.Scheduled);
            Flight     testFlight     = new Flight(testAirplane, new Person("Pesho"), testFlightPlan, "2213");

            flights.Add(testFlight);

            Planes.Add(new Plane
            {
                Identification = testFlight.Aircraft.Identification.Id,
                Speed          = testFlight.CurrentSpeed,
                X           = testFlight.CurrentPosition.LongitudeInNauticalMiles / 18,
                Y           = testFlight.CurrentPosition.LatitudeInNauticalMiles / 18,
                Z           = (int)testFlight.CurrentPosition.Altitude,
                Company     = "Pacific Airlines",
                Destination = "1", // testFlight.FlightPlan.ArrivalAirport.Name,
                Type        = 1
            });
        }
        static void Main(string[] args)
        {
            Console.WriteLine((Math.Sin(MeasureConverter.ConvertDegreeToRadian(210))));
            Console.WriteLine(MeasureConverter.ConvertRadiansToDegrees(Math.Asin(-0.5)));
            AircraftIdData testData = new AircraftIdData();
            //AirTrafficController testController = new AirTrafficController(TrafficControllerType.Approach);
            var         testPilot         = new Person("ivan");
            Airport     testDeparturePort = new Airport("testAirport", new Position3D(0, 0, 1), new Person("disp"));
            Airport     testArrivalPort   = new Airport("testAirport2", new Position3D(10, 10, 1), new Person("disp"));
            Airport     newAirport        = new Airport("John F. Kennedy International Airport", new Position3D(-90.9187999m, 46.5482781m, 251), new Person("John Kennedy"));
            FlightRoute testRoute         = new FlightRoute();

            testRoute.AddFix(new AirspaceFix(new Position3D(2, 2, 2), false, false));
            FlightPlan testPlan     = new FlightPlan(testDeparturePort, testArrivalPort, new DateTime(), new DateTime(), 10000, testRoute, 100, FlightType.Cargo);
            Aircraft   testAircraft = new Aircraft(testData, 45);
            var        flight       = new Flight(testAircraft, testPilot, testPlan, "7382");

            Console.WriteLine(flight.CurrentPosition);

            while (true)
            {
                flight.UpdatePosition();
                Console.WriteLine(flight.CurrentPosition);
                System.Threading.Thread.Sleep(3000);
            }
        }