Beispiel #1
0
        public void LoadTest()
        {
            var lines = List(
                "1A,WILLIAMS HARBOUR,373.000,0,0,110,52.55938,-55.78192,0,CY,0,1,0",
                "1B,SABLE ISLAND,277.000,0,0,110,43.93056,-60.02278,0,CY,0,1,0",
                "1D,CHARLOTTETOWN,346.000,0,0,110,52.77541,-56.12596,0,CY,0,1,0",
                "");

            var navaids = NavaidsLoader.Load(lines);
            var x       = new Navaid()
            {
                ID          = "1A",
                Name        = "WILLIAMS HARBOUR",
                Freq        = "373.000",
                IsVOR       = false,
                IsDME       = false,
                RangeNm     = 110,
                Lat         = 52.55938,
                Lon         = -55.78192,
                CountryCode = "CY"
            };

            Assert.AreEqual(3, navaids.Count);
            Assert.AreEqual(x, navaids.FindAny("1A"));
            Assert.AreEqual(43.93056, navaids.FindAny("1B").Lat);
            Assert.AreEqual("346.000", navaids.FindAny("1D").Freq);
        }
Beispiel #2
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);
     }
 }
Beispiel #3
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);
        }