Esempio n. 1
0
        public void ParseRunwayVfrUse(string line, List <Runway> runways)
        {
            string[]  tokens = line.Split(_splitters, StringSplitOptions.RemoveEmptyEntries);
            RunwayUse ru     = GetUse(tokens[1]);

            ru.Arrivals   = true;
            ru.Departures = true;
            ru.XpTypes.Add(XPlaneAircraftType.Prop); // Very cautious, though types from other rules for this runway will be added as well.

            Runway r = runways.SingleOrDefault(rw => rw.Designator == tokens[1]);

            if (r != null)
            {
                r.AvailableForVFR = true;
            }
        }
Esempio n. 2
0
        private void ReadRunwayRecord(string line)
        {
            string[] tokens = line.Split(_splitters, StringSplitOptions.RemoveEmptyEntries);

            double latitude1  = VortexMath.ParseDegreesToRadians(tokens[9]);
            double longitude1 = VortexMath.ParseDegreesToRadians(tokens[10]);
            double latitude2  = VortexMath.ParseDegreesToRadians(tokens[18]);
            double longitude2 = VortexMath.ParseDegreesToRadians(tokens[19]);

            Runway r1 = new Runway(tokens[8], latitude1, longitude1, VortexMath.Parse(tokens[11]) / 1000.0);

            r1.LogMessage += RelayMessage;

            Runway r2 = new Runway(tokens[17], latitude2, longitude2, VortexMath.Parse(tokens[20]) / 1000.0);

            r2.LogMessage += RelayMessage;

            r1.OppositeEnd = r2;
            r2.OppositeEnd = r1;

            _runways.Add(r1);
            _runways.Add(r2);
        }
Esempio n. 3
0
        public void ParseRunwayUse(string line, List <Runway> runways)
        {
            string[]  tokens = line.Split(_splitters, StringSplitOptions.RemoveEmptyEntries);
            RunwayUse ru     = GetUse(tokens[1]);

            ru.Arrivals   |= (tokens[3].Contains("arr"));
            ru.Departures |= (tokens[3].Contains("dep"));
            ru.XpTypes.AddRange(AircraftTypeConverter.XPlaneTypesFromStrings(tokens[4].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)));

            Runway r = runways.SingleOrDefault(rw => rw.Designator == ru.Designator);

            if (r != null)
            {
                if (ru.Arrivals)
                {
                    r.AvailableForLanding = true;
                }

                if (ru.Departures)
                {
                    r.AvailableForTakeOff = true;
                }
            }
        }