Example #1
0
        private void LoadButton_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog();

            dialog.Filter      = "ts files (*.ts)|*.ts|s4p files (*.s4p)|*.s4p";
            dialog.FilterIndex = 1;
            LoadGraph data = new LoadGraph();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (dialog.FileName.Contains(".s4p"))
                {
                    data = ParamFileSaveLoader.LoadS4p(dialog.FileName);
                }
                if (dialog.FileName.Contains(".ts"))
                {
                    data = ParamFileSaveLoader.LoadTs(dialog.FileName);
                }

                if (data.inParams)
                {
                    var graphForm = new FormForGraph(data.CurrentParams, data.RelatedData);
                    graphForm.Show();
                }
                else
                {
                    var ss = new double[][]
                    {
                        data.data[1], data.data[3], data.data[5], data.data[7], data.data[11], data.data[13],
                        data.data[15], data.data[21], data.data[23], data.data[31]
                    };
                    var ff = new double[][]
                    {
                        data.data[2], data.data[4], data.data[6], data.data[8], data.data[12], data.data[14],
                        data.data[16], data.data[22], data.data[24], data.data[32]
                    };
                    var graphForm = new FormForGraph(ss, ff, data);
                    graphForm.Show();
                }
            }
        }
        private void graphToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var graphForm = new FormForGraph(_currentParams);

            graphForm.Show();
        }