Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a table to this table (omitting key dupes)
        /// </summary>
        /// <param name="subtable">A table to add to this table</param>
        public string AddSubtable(rwyTable subtable)
        {
            string ret = "";

            foreach (var rec in subtable)
            {
                try {
                    ret += this.Add(rec.Value);
                }
                catch { }
            }
            return(ret);
        }
Beispiel #3
0
        /// <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);
        }
Beispiel #4
0
 /// <summary>
 /// cTor: init the database
 /// </summary>
 public rwyDatabase()
 {
     m_db = new rwyTable( );
 }
Beispiel #5
0
 /// <summary>
 /// Create an ICAO table from the given table
 /// </summary>
 /// <param name="prefix">The prefix of the table</param>
 /// <param name="table">The source to fill from</param>
 public rwyTable(rwyTable table)
 {
     this.AddSubtable(table);
 }