public static List <Electrode> GetTherapeuticProfileData(string profileName)
        {
            List <Electrode> list = new List <Electrode>();
            int i = 1;

            using (var reader = new StreamReader("Profiles/" + profileName + ".csv"))
            {
                reader.ReadLine(); // SKIP FIRST LINE

                while (!reader.EndOfStream)
                {
                    var       line      = reader.ReadLine();
                    var       values    = line.Split(',');
                    Electrode electrode = new Electrode("Electrode " + i);
                    int       j         = 0;
                    foreach (string value in values)
                    {
                        if (value != "")
                        {
                            Console.WriteLine(value);
                            electrode.therapeuticValues[j] = int.Parse(value);
                            j++;
                        }
                    }
                    list.Add(electrode);
                    i++;
                }
                reader.Close();
            }
            return(list);
        }
Esempio n. 2
0
 public void EmptyElectrodeList(int electrodes)
 {
     for (int i = 0; i < electrodes; i++)
     {
         Electrode el = new Electrode("Electrode " + (i + 1));
         electrodeList.Add(el);
     }
 }