public string locName = ""; // LOC: Localizer name, Use “ILS-cat-I”, “ILS-cat-II”, “ILS-cat-III”, “LOC”, “LDA” or “SDF” // GS: 'GS' // BEACON: “OM”, “MM” or “IM” // DME: DME name (all DMEs) “DME-ILS” if associated with ILS, Suffix “DME” to navaid name for VOR-DMEs, VORTACs & NDB-DMEs // ( eg. “SEATTLE VORTAC DME” in example data ) For standalone DMEs just use DME name // GLS: 'GLS' // FIX: not used // NOTE : type 14 (FPAP) /16 (LTP/FTP) are not captured /// <summary> /// cTor: populate the record /// </summary> /// <param name="id">ident (UPPERCASE)</param> public navRec(NavTypes rt, string la, string lo, string elev, string f, string r, string dev, string i_id, string t_id, string i_reg, string nam, string lnam) { #if !DEBUG try { #endif recType = rt; lat = double.Parse(la); lon = double.Parse(lo); if (int.TryParse(elev, out int e)) { elevation = e; } freq = f; range = r; deviation = dev; icao_id = i_id; terminal_id = t_id; icao_region = i_reg; name = nam; locName = lnam; #if !DEBUG } catch { recType = NavTypes.Unknown; // not a valid location } #endif ident = $"{icao_id}_{icao_region}"; LatLon = new LatLon(lat, lon); }
public string locName = ""; // LOC: Localizer name, Use “ILS-cat-I”, “ILS-cat-II”, “ILS-cat-III”, “LOC”, “LDA” or “SDF” // GS: 'GS' // BEACON: “OM”, “MM” or “IM” // DME: DME name (all DMEs) “DME-ILS” if associated with ILS, Suffix “DME” to navaid name for VOR-DMEs, VORTACs & NDB-DMEs // ( eg. “SEATTLE VORTAC DME” in example data ) For standalone DMEs just use DME name // GLS: 'GLS' // FIX: not used // NOTE : type 14 (FPAP) /16 (LTP/FTP) are not captured /// <summary> /// cTor: populate the record /// </summary> /// <param name="id">ident (UPPERCASE)</param> public navRec(NavTypes rt, string la, string lo, string elev, string f, string r, string dev, string i_id, string t_id, string i_reg, string nam, string lnam) { recType = rt; lat = la; lon = lo; elevation = elev; freq = f; range = r; deviation = dev; icao_id = i_id; terminal_id = t_id; icao_region = i_reg; name = nam; locName = lnam; ident = $"{icao_id}_{icao_region}"; }
/// <summary> /// Returns a subtable with items that match the given criteria /// </summary> /// <param name="rangeLimitNm">Range Limit in nm</param> /// <param name="Lat">Center Lat (decimal)</param> /// <param name="Lon">Center Lon (decimal)</param> /// <param name="navTypes">Type of nav items to include</param> /// <returns>A table with selected records</returns> public navTable GetSubtable(double rangeLimitNm, double Lat, double Lon, NavTypes[] navTypes = null) { if (navTypes == null) { navTypes = new NavTypes[] { NavTypes.All } } ; var nT = new navTable( ); var myLoc = new LatLon(Lat, Lon); foreach (var rec in this) { var dist = myLoc.DistanceTo(rec.Value.LatLon, ConvConsts.EarthRadiusNm); if ((dist <= rangeLimitNm) && (rec.Value.IsTypeOf(navTypes))) { nT.Add(rec.Value); } } return(nT); } }