/// <summary> /// Add one record to the table /// </summary> /// <param name="rec">The awyRec to add</param> public string Add(rwyRec rec) { if (rec != null) { return(m_db.Add(rec)); } return(""); }
/// <summary> /// Return an Runway subtable where airport_runwy key matches /// </summary> /// <param name="icao_key">The icao to match</param> /// <returns>A rwyTable</returns> public rwyTable GetSubtable(string icao_key) { var l = this.Where(x => x.Key == icao_key); var t = new rwyTable( ); foreach (var kv in l) { t.Add(kv.Key, kv.Value); } return(t); }
/// <summary> /// Return an Runway subtable for Runways in range /// </summary> /// <param name="icao_key">The icao to match</param> /// <returns>A rwyTable</returns> public rwyTable GetSubtable(double rangeLimitNm, double Lat, double Lon) { var nT = new rwyTable( ); var myLoc = new LatLon(Lat, Lon); foreach (var rec in this) { var dist = myLoc.DistanceTo(rec.Value.start_latlon, ConvConsts.EarthRadiusNm); if (dist <= rangeLimitNm) { nT.Add(rec.Value); } } return(nT); }