コード例 #1
0
        public Airplane(string hexCode, string flightName, AltitudeMetric altitude, double latitude, double longitude, SpeedMetric speed, double verticalSpeed, double direction, string from, string to, string model, string registration, bool isOnGround)
        {
            var airplaneDatabaseData = AircraftDatabase.GetByICAO(hexCode);

            this.ID    = hexCode;
            this.Model = airplaneDatabaseData != null?AircraftModel.GetByICAO(airplaneDatabaseData.AircraftModelName) : null;

            this.Direction      = direction;
            this.From           = Airport.GetAirportByIata(from);
            this.Name           = flightName.Trim();
            this.Airline        = Airline.GetAirlineByFlight(flightName);
            this.Position       = new GeoPosition(latitude, longitude, altitude);
            this.Registration   = new AircraftRegistration(registration);
            this.Speed          = speed;
            this.To             = Airport.GetAirportByIata(to);
            this.VerticalSpeed  = verticalSpeed;
            this.DateCreation   = DateTime.Now;
            this.IsOnGround     = isOnGround;
            this.DateExpiration = DateTime.Now.AddHours(1);
        }
コード例 #2
0
 /// <summary>
 /// Load an external database file with data from the most airplanes of the world.
 /// Currently it is only supporting the CSV file provided by Open Sky Network (https://opensky-network.org/aircraft-database).
 /// </summary>
 public static void LoadAircraftDatabase(string fileName, AircraftDatabaseType database)
 {
     AircraftDatabase.LoadAircraftDatabaseFromOpenSky(fileName);
 }