Exemplo n.º 1
0
 public FlightInfo(EnrouteFlightStruct flight)
 {
     Id          = flight.ident;
     Name        = flight.originCity + "-" + flight.destinationCity;
     Origin      = flight.originCity;
     Destination = flight.destination;
 }
Exemplo n.º 2
0
        private bool isEnroute(EnrouteFlightStruct aircraft)
        {
            var utcNow = (TimeZoneInfo.ConvertTimeToUtc(DateTime.Now) -
                          new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;

            return(aircraft.estimatedarrivaltime > utcNow && aircraft.actualdeparturetime > 0);
        }
Exemplo n.º 3
0
 private void sendFlight(List <OMFEndpoint> endpoints, EnrouteFlightStruct flight)
 {
     foreach (OMFEndpoint endpoint in endpoints)
     {
         endpoint.sendMessage("create", "data", JsonConvert.SerializeObject(new Data <FlightInfo>("flight", false).Add(new FlightInfo(flight)), noNull));
         endpoint.sendMessage("create", "container", JsonConvert.SerializeObject(new Container(flight.ident, flight), noNull));
     }
 }
        public List <Flight> getFlightFromAirport(string Airportname, int noOfFlights, string filter, int offset)
        {
            EnrouteStruct enrouteStruct = flightXML_.Enroute(Airportname, noOfFlights, filter, offset);
            List <Flight> FlightObjects = new List <Flight>();

            if (enrouteStruct.enroute != null)
            {
                int num = enrouteStruct.enroute.Length;


                for (int i = 0; i < num; i++)
                {
                    EnrouteFlightStruct enrouteflight = enrouteStruct.enroute[i];
                    List <Flight>       flightList    = getFlightInformation(enrouteflight.ident);
                    foreach (Flight f in flightList)
                    {
                        FlightObjects.Add(f);
                    }
                }

                return(FlightObjects);
            }
            return(FlightObjects);
        }
Exemplo n.º 5
0
 public Container(String id, EnrouteFlightStruct flight)
 {
     this.id = id;
     typeid  = "flight_update";
     name    = flight.originCity + "-" + flight.destinationCity;
 }