Пример #1
0
        public bool ParseInfo(string line, List <Runway> runways)
        {
            if (line.Length > 4)
            {
                switch (line.Substring(0, 4))
                {
                case "1000":
                    _currentRule = new TrafficRule(line);
                    TrafficRules.Add(_currentRule);

                    if (!_flowRulesFound)
                    {
                        foreach (Runway rw in runways)
                        {
                            rw.AvailableForLanding = false;
                            rw.AvailableForTakeOff = false;
                            rw.AvailableForVFR     = false;
                        }
                        _flowRulesFound = true;
                    }
                    return(true);

                case "1001":
                    _currentRule.ParseWindRule(line);
                    return(true);

                case "1002":
                    _currentRule.ParseCeilingRule(line);
                    return(true);

                case "1003":
                    _currentRule.ParseVisibilityRule(line);
                    return(true);

                case "1004":
                    _currentRule.ParseTimeRule(line);
                    return(true);

                case "1100":                           // Pre wed 2.0
                case "1110":                           // As of wed 2.0
                    if (line.StartsWith("1100 Gener")) // Pre wed 2.0 work around
                    {
                        return(false);
                    }
                    _currentRule.ParseRunwayUse(line, runways);
                    return(true);

                case "1101":
                    _currentRule.ParseRunwayVfrUse(line, runways);
                    return(true);

                default:
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// Add operations and runways for the generated operations
        /// </summary>
        /// <param name="ruleIdx"></param>
        /// <param name="rule"></param>
        /// <param name="windLimit"></param>
        /// <param name="currentMinWindSpeed"></param>
        /// <param name="currentMaxWindSpeed"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        private void GenerateOperations(ref int ruleIdx, TrafficRule rule, WindLimits windLimit, int currentMinWindSpeed, int currentMaxWindSpeed, string startTime, string endTime)
        {
            // Extend the upper limit of the wind rule to make it match WT behavior
            if (_noOverlap)
            {
                windLimit.MaxDir++;
            }
            windLimit.MaxDir = Math.Min(360, windLimit.MaxDir);

            // Write the operation, and track whether it actually resulted in two operations
            bool splitOperation = GenerateOperation(ruleIdx, currentMinWindSpeed, windLimit, startTime, endTime, rule.Description);

            Logger.Log($"{currentMinWindSpeed,3}-{currentMaxWindSpeed,3} kts {windLimit.MinDir:000}-{windLimit.MaxDir:000} {startTime} {endTime}");

            // Write the runways for the (or both) operation(s)
            GenerateRunways(rule.RunwayUses, ruleIdx++, startTime, endTime, rule.Description);
            if (splitOperation)
            {
                GenerateRunways(rule.RunwayUses, ruleIdx++, startTime, endTime, rule.Description);
            }
        }
Пример #3
0
 public TrafficFlow()
 {
     TrafficRules    = new List <TrafficRule>();
     _currentRule    = null;
     _flowRulesFound = false;
 }