EKG_Project.IO.HRV_DFA_Data_Worker.Load C# (CSharp) Method

Load() public method

public Load ( ) : void
return void
        public void Load()
        {
            HRV_DFA_Data basicData = new HRV_DFA_Data();
            XMLConverter converter = new XMLConverter(analysisName);

            XmlDocument file = new XmlDocument();
            string fileName = analysisName + "_Data.xml";
            file.Load(System.IO.Path.Combine(directory, fileName));

            XmlNodeList modules = file.SelectNodes("EKG/module");

            string moduleName = this.GetType().Name;
            moduleName = moduleName.Replace("_Data_Worker", "");

            foreach (XmlNode module in modules)
            {
                if (module.Attributes["name"].Value == moduleName)
                {
                    List<Tuple<string, Vector<double>>> DfaNumberN = new List<Tuple<string, Vector<double>>>();
                    XmlNodeList dfaNumberN = module.SelectNodes("DfaNumberN");
                    foreach (XmlNode node in dfaNumberN)
                    {
                        XmlNode lead = node["lead"];
                        string readLead = lead.InnerText;

                        XmlNode samples = node["samples"];
                        string readSamples = samples.InnerText;
                        Vector<double> readDigits = converter.stringToVector(readSamples);

                        Tuple<string, Vector<double>> readDfaNumberN = Tuple.Create(readLead, readDigits);
                        DfaNumberN.Add(readDfaNumberN);
                    }
                    basicData.DfaNumberN = DfaNumberN;

                    List<Tuple<string, Vector<double>>> DfaValueFn = new List<Tuple<string, Vector<double>>>();
                    XmlNodeList dfaValueFn = module.SelectNodes("DfaValueFn");
                    foreach (XmlNode node in dfaValueFn)
                    {
                        XmlNode lead = node["lead"];
                        string readLead = lead.InnerText;

                        XmlNode samples = node["samples"];
                        string readSamples = samples.InnerText;
                        Vector<double> readDigits = converter.stringToVector(readSamples);

                        Tuple<string, Vector<double>> readDfaValueFn = Tuple.Create(readLead, readDigits);
                        DfaValueFn.Add(readDfaValueFn);
                    }
                    basicData.DfaValueFn = DfaValueFn;

                    List<Tuple<string, Vector<double>>> ParamAlpha = new List<Tuple<string, Vector<double>>>();
                    XmlNodeList paramAlpha = module.SelectNodes("ParamAlpha");
                    foreach (XmlNode node in paramAlpha)
                    {
                        XmlNode lead = node["lead"];
                        string readLead = lead.InnerText;

                        XmlNode samples = node["samples"];
                        string readSamples = samples.InnerText;
                        Vector<double> readDigits = converter.stringToVector(readSamples);

                        Tuple<string, Vector<double>> readParamAlpha = Tuple.Create(readLead, readDigits);
                        ParamAlpha.Add(readParamAlpha);
                    }
                    basicData.ParamAlpha = ParamAlpha;
                }
                }
                this.Data = basicData;
        }