Beispiel #1
0
        private void InitializeStationNames()
        {
            Console.WriteLine("At InitializeStatementNames, Parent is Null = " + (Parent == null));
            char c = 'A';

            for (int i = 50000; i < 65536; i += 1000)
            {
                StationNames.Add(i, c.ToString());
                c++;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 获取观测数据的测站以及测站的所有doy
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public void GetStationDOY()
        {
            DirectoryInfo dir = new DirectoryInfo(Folder);

            if (!dir.Exists)
            {
                return;
            }

            foreach (var file in dir.GetFiles("*.??o"))
            {
                //// 匹配文件名(o文件)
                if (file.Name.Length != 12 ||
                    !Regex.IsMatch(file.Name, @"^\S{4}\d{3}\S.\d{2}[Oo]"))
                {
                    continue;
                }

                //// 截取测站名、年份、年积日
                string stationName = file.Name.Substring(0, 4);
                int    doy         = int.Parse(file.Name.Substring(4, 3));
                int    year        = int.Parse(file.Name.Substring(9, 2));
                if (year < 50)
                {
                    year += 2000;
                }
                else
                {
                    year += 1900;
                }

                if (!DOYs.ContainsKey(stationName))
                {
                    DOYs.Add(stationName, new List <DOY>());
                }

                StationNames.Add(stationName);
                DOYs[stationName].Add(new DOY(year, doy));
            }

            //// DOY排序
            foreach (var station in DOYs)
            {
                station.Value.Sort();
            }
        }
Beispiel #3
0
        private void InitializeStationNames()
        {
            char c = '0';
            char d = '0';

            for (int i = 0; i < 256; i++)
            {
                StationNames.Add(i, "0x" + c.ToString() + d.ToString());
                d++;
                if (d > '9' && !(d >= 'A'))
                {
                    d = 'A';
                }
                else if (d > 'F')
                {
                    d = '0';
                    c++;
                }
            }
        }