/// <exception cref="Exception"></exception>
        private void FindRoutePrivate()
        {
            var orig = origProvider.Icao;
            var dest = destProvider.Icao;

            EnsureAirportExists(orig);
            EnsureAirportExists(dest);

            var sid  = origProvider.GetSelectedProcedures().ToList();
            var star = destProvider.GetSelectedProcedures().ToList();

            var finder = new RouteFinderFacade(
                airwayNetwork.WptList,
                airwayNetwork.AirportList,
                AppOptions.NavDataLocation,
                checkedCodesLocator.Instance,
                windCalcGetter());

            Route = new RouteGroup(
                finder.FindRoute(
                    orig, origProvider.Rwy, sid,
                    dest, destProvider.Rwy, star),
                airwayNetwork.TracksInUse);

            view.ShowRouteTxt(Route, AppOptions);
        }
Пример #2
0
        // Can throw exceptions.
        private void FindRoute()
        {
            var orig = origController.Icao;
            var dest = destController.Icao;

            if (AirportList[orig] == null)
            {
                throw new ArgumentException("Cannot find origin airport in Nav Data.");
            }

            if (AirportList[dest] == null)
            {
                throw new ArgumentException("Cannot find destination airport in Nav Data.");
            }

            var sid  = origController.GetSelectedProcedures();
            var star = destController.GetSelectedProcedures();

            var finder = new RouteFinderFacade(
                airwayNetwork.WptList,
                airwayNetwork.AirportList,
                AppSettings.NavDataLocation,
                checkedCodesLocator.Instance,
                windCalcGetter());

            Route = new RouteGroup(
                finder.FindRoute(
                    orig, origController.Rwy, sid,
                    dest, destController.Rwy, star),
                airwayNetwork.TracksInUse);

            ShowRouteTxt();
        }