Example #1
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(navTable subtable)
        {
            string ret = "";

            foreach (var rec in subtable)
            {
                try {
                    ret += this.Add(rec.Value);
                }
                catch { }
            }
            return(ret);
        }
Example #2
0
        /// <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);
        }
    }
Example #3
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 navTable(navTable table)
 {
     this.AddSubtable(table);
 }
Example #4
0
 /// <summary>
 /// cTor: init the database
 /// </summary>
 public navDatabase()
 {
     m_db = new navTable( );
 }