Exemple #1
0
        /// <summary>
        /// 读取数据源表
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, SourceTable> LoadSourceTables()
        {
            var tables = new Dictionary <string, SourceTable>();

            foreach (var item in this.NtripCasters.Values)
            {
                var         local   = Path.Combine(Setting.ApplicationDirectory, item.SourceTablePath);
                var         localBk = local + ".bak";
                SourceTable table   = null;
                if (File.Exists(local))
                {
                    table = SourceTable.Load(local);
                }
                else if (File.Exists(localBk))
                {
                    table = SourceTable.Load(localBk);
                }

                if (table != null)
                {
                    tables.Add(item.Name, table);
                }
            }
            return(tables);
        }
Exemple #2
0
        /// <summary>
        /// 直接从网络获取数据源表
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="port">端口</param>
        /// <returns></returns>
        public static SourceTable GetSourceTableFromNet(string host = "http://www.igs-ip.net", int port = 2101)
        {
            var tableStr = GetSourceTableStringFromNet(host, port);

            return(SourceTable.Parse(tableStr));
        }