Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)//Открыть файл
        {
            string adres    = "q";
            string adres2   = "q";
            string datapath = "w";

            int da5 = 0;

            StringBuilder       buffer2 = new StringBuilder();
            FolderBrowserDialog fbd     = new FolderBrowserDialog();
            OpenFileDialog      qqq     = new OpenFileDialog();

            qqq.Filter = "Файлы txt|*.txt";

            if (qqq.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                adres = qqq.FileName;
                buffer2.Insert(0, qqq.FileName);

                da5 = buffer2.Length;
                buffer2.Remove(da5 - 8, 8);
                adres2   = buffer2.ToString();
                datapath = Path.Combine(Application.StartupPath);

                System.IO.File.Copy(Path.Combine(qqq.InitialDirectory, qqq.FileName), Path.Combine(datapath, "test.txt"), true);
                try
                {
                    System.IO.File.Copy(adres2 + "Информация о пациенте.txt", Path.Combine(datapath, "Информация о пациенте.txt"), true);
                }
                catch
                {    }
            }

            ///////////////////////////////////////////////////////////

            int reg = Convert.ToInt32(this.textBox1.Text);
            int ekg = 1;

            try
            {
                Initial_data init_data = new Initial_data("test.txt", reg, ekg);
                init_data.Shift_Row1_To_Time_0(); //Сдвигаем время к 0
                init_data.Smoothe_Row1();         // Сглаживаем полученные данные
                init_data.Write_In_File_Row1("test3.txt");

                usergraph = new UseZedgraph(zedGraph1);
                usergraph.ClearAll();                                                              //Очищаем полотно
                usergraph.MakeGraph_4_Canal(init_data.Get_Row1(), init_data.Get_Number_Strings()); //Строим график
                usergraph.Install_Pane("t, мc", "R, Ом", "Каналы");                                //Устанавливаем оси и загавие
                usergraph.ResetGraph();                                                            //Обновляем
            }
            catch (Exception ex)
            {
                MessageBox.Show("Выбран неправильный файл");
            }
        }