Пример #1
0
        private void timeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string input;

            input = Interaction.InputBox("Введите номер строки", "", "");
            int row;

            if (!Int32.TryParse(input, out row))
            {
                row = -1;
            }
            if (row >= 0 && Data.maxtime > row)
            {
                var func = new float[data.GetLength(0)];
                for (int i = 0; i < func.Length; i++)
                {
                    func[i] = curImg.GetValue(new Tuple <int, int>(i, row));
                }

                var funcs  = new Dictionary <string, float[]>();
                var spectr = FuncProc.GetDiscreteSpectre(func);
                funcs.Add("Спектр", spectr);

                var modalFuncs = new TrendModal(funcs);
                modalFuncs.Show();
            }
        }
Пример #2
0
        private void xToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            string input;

            input = Interaction.InputBox("Введите номер столбца", "", "");
            int col;

            if (!Int32.TryParse(input, out col))
            {
                col = -1;
            }
            if (col >= 0 && Data.width > col)
            {
                var func = new float[data.GetLength(1)];
                for (int j = 0; j < func.Length; j++)
                {
                    func[j] = curImg.GetValue(new Tuple <int, int>(col, j));
                }

                var funcs  = new Dictionary <string, float[]>();
                var spectr = FuncProc.GetDiscreteSpectre(func);
                funcs.Add("Спектр", spectr);

                var modalFuncs = new TrendModal(funcs);
                modalFuncs.Show();
            }
        }
Пример #3
0
        public static TrendModal CreateAndShow(Dictionary <string, float[]> funcList, SeriesChartType type = SeriesChartType.Line)
        {
            var modal = new TrendModal(funcList, type);

            modal.Show();
            return(modal);
        }
Пример #4
0
        public static TrendModal CreateAndShow(float[] func, SeriesChartType type = SeriesChartType.Line)
        {
            var modal = new TrendModal(func, type);

            modal.Show();
            return(modal);
        }
Пример #5
0
        private void показатьСигналToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            data = new float[1, Data.signal.Length];
            for (int i = 0; i < Data.signal.Length; i++)
            {
                data[0, i] = Data.signal[i];
            }
            var modalFuncs1 = new TrendModal(Data.signal);

            modalFuncs1.Show();
            DrawImage();
        }
Пример #6
0
        private void фВЧToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            string input;

            input = Interaction.InputBox("Введите частоту среза", "ФВЧ построчно", "");
            double fcut;

            if (!Double.TryParse(input, out fcut))
            {
                fcut = 0;
            }
            if (fcut > 0)
            {
                input = Interaction.InputBox("Введите m", "ФВЧ построчно", "");
                int m;
                if (!Int32.TryParse(input, out m))
                {
                    m = 32;
                }

                var filter = FuncProc.Hpf((float)fcut, m);

                var modalFuncs1 = new TrendModal(FuncProc.GetDiscreteSpectre(filter));
                modalFuncs1.Show();


                var msgBoxResult = Interaction.MsgBox("На все данные?", MsgBoxStyle.YesNo);
                switch (msgBoxResult)
                {
                case MsgBoxResult.Yes:
                    Data.WholeApplyFilter(filter);
                    LoadNewSlice();
                    break;

                case MsgBoxResult.No:
                    data = FuncProc.ApplyFilter(data, filter);
                    break;
                }
                DrawImage();
            }
        }