示例#1
0
        private EPWFile defineFormat()
        {
            EPWFile      epw  = new EPWFile();
            StreamReader sr   = new StreamReader(@"C:\Users\Admin\Documents\projects\IAPP\piloto\Climate\ClimateDataETL\epwFormat.txt");
            string       line = sr.ReadLine();
            EPWGroup     g    = new EPWGroup();
            EPWField     f    = new EPWField();

            while (line != null)
            {
                var parts = line.Split(',');
                if (parts.Length == 1)
                {
                    g      = new EPWGroup();
                    g.name = parts[0];
                    epw.groups.Add(g);
                }
                else
                {
                    if (parts[0].Contains("A") || parts[0].Contains("N"))
                    {
                        f      = new EPWField();
                        f.name = parts[0];
                        g.fields.Add(f);
                        f.keyValues.Add(new KeyValuePair <string, string>(parts[1], parts[2]));
                    }
                    else
                    {
                        f.keyValues.Add(new KeyValuePair <string, string>(parts[0], parts[1]));
                    }
                }
                line = sr.ReadLine();
            }
            sr.Close();
            return(epw);
        }
示例#2
0
 public EPWFile(EPWFile other)
 {
     groups = new List <EPWGroup>(other.groups);
 }
示例#3
0
 public EPWsummary()
 {
     epwFormat = defineFormat();
     printFormat();
 }