public static ResearchResults FromXml(XmlNode node)
        {
            ResearchResults rr = new ResearchResults();

            if (node == null)
                return rr;

            int i = 0;
            int j = 0;
            int k = 0;
            int l = 0;
            foreach (XmlNode result_node in node.ChildNodes)
            {
                try
                {
                    switch (result_node.Name)
                    {
                        case "sound_proof":
                            rr.SoundproofLefel[i++] = Double.Parse(result_node.FirstChild.Value);
                            break;
                        case "ratio":
                            rr.Ratio[j++] = Double.Parse(result_node.FirstChild.Value);
                            break;
                        case "w":
                            rr.W = Double.Parse(result_node.FirstChild.Value);
                            break;
                        case "signal_level":
                            rr.SignalLevel[k++] = Double.Parse(result_node.FirstChild.Value);
                            break;
                        case "noise_level":
                            rr.NoiseLevel[l++] = Double.Parse(result_node.FirstChild.Value);
                            break;
                    }
                }
                catch
                {
                    Console.WriteLine("Can't read Result Node");
                }
            }

            return rr;
        }
예제 #2
0
 public CheckPoint()
 {
     Results = new ResearchResults();
 }