EKG_Project.IO.XMLConverter.getFrequency C# (CSharp) Метод

getFrequency() публичный Метод

public getFrequency ( ) : uint
Результат uint
        public uint getFrequency()
        {
            uint frequency = 0;
            foreach (XmlNode sequence in sequences)
            {
                XmlNode value = sequence["value"];
                if (value.Attributes["xsi:type"].Value == "GLIST_PQ")
                {
                    XmlNode increment = value["increment"];

                    string incrementValue = increment.Attributes["value"].Value;
                    double readIncrement = Convert.ToDouble(incrementValue, new System.Globalization.NumberFormatInfo());
                    frequency = (uint) (1 / readIncrement); //Hz

                    string incrementUnit = increment.Attributes["unit"].Value; //s
                }
            }
            return frequency;
        }

Usage Example

Пример #1
0
        public static void Main()
        {
            IECGPath pathBuilder = new DebugECGPath();
            XMLConverter xml = new XMLConverter("TestAnalysis");
            xml.ConvertFile(System.IO.Path.Combine(pathBuilder.getDataPath(), "6.xml"));
            xml.SaveResult();

            //xml.loadXMLFile(@"C:\temp\6.xml");

            uint f = xml.getFrequency();
            Console.WriteLine("Frequency: " + f + " Hz");

            uint samples = xml.sampleAmount;
            Console.WriteLine("Sample amount: " + samples.ToString());
            Console.WriteLine();

            List<Tuple<string, Vector<double>>> signals = xml.getSignals();
            foreach (var tuple in signals)
            {
                Console.WriteLine("Lead name: " + tuple.Item1);
                Console.WriteLine("Signal Vector in uV: " + tuple.Item2);
                Console.WriteLine();

            }

            Console.Read();
        }