Exemplo n.º 1
0
 // If failed, returns null.
 private MultiMap <string, Navaid> TryLoadNavaids()
 {
     try
     {
         var dir = pathTxtBox.Text;
         return(NavaidsLoader.LoadFromFile(Path.Combine(dir, "navaids.txt")));
     }
     catch (Exception ex)
     {
         Log(ex);
         this.ShowError("Failed to load navaids.txt.");
         return(null);
     }
 }
Exemplo n.º 2
0
        /// <exception cref="Exception"></exception>
        private void InitAirportAndWaypoints()
        {
            string navDataPath    = AppSettings.NavDataLocation;
            var    airportTxtPath = Path.Combine(navDataPath, "Airports.txt");

            var airportResult = AirportDataLoader.LoadFromFile(airportTxtPath);
            var err           = airportResult.Errors;

            if (err.Any())
            {
                Log(ReadFileErrorMsg.ErrorMsg(err, "ats.txt"));
            }
            var airports = airportResult.Airports;

            var result = new WptListLoader(navDataPath).LoadFromFile();

            countryCodesLocator = result.CountryCodes.ToLocator();

            var navaids = NavaidsLoader.LoadFromFile(Path.Combine(navDataPath, "navaids.txt"));

            airwayNetwork = new AirwayNetwork(result.WptList, airports, navaids);
        }