Beispiel #1
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();
            }
        }
Beispiel #2
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();
            }
        }
Beispiel #3
0
        private void вертиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string input;

            input = Interaction.InputBox("Введите dV", "", "100");
            int dV;

            if (!Int32.TryParse(input, out dV))
            {
                return;
            }
            data = Data.CreateSpeedMatrix(data, currentSlice, dV, 10000);
            var maxData = new float[Data.maxtime];

            for (int t = 0; t < Data.maxtime; t++)
            {
                var max = (float)Double.NegativeInfinity;
                //float sum = 0;
                //float weight = 0;
                for (int i = 0; i < data.GetLength(0); i++)
                {
                    //sum += i * dV * data[i, t];
                    //weight += data[i, t];
                    if (data[i, t] > max)
                    {
                        max        = data[i, t];
                        maxData[t] = i * dV;
                    }
                }
                //maxData[t] = sum / weight;
            }
            //maxData = FuncProc.AntiSpike(maxData);
            TrendModal.CreateAndShow(maxData);
            DrawImage(false);
        }
Beispiel #4
0
        public static TrendModal CreateAndShow(Dictionary <string, float[]> funcList, SeriesChartType type = SeriesChartType.Line)
        {
            var modal = new TrendModal(funcList, type);

            modal.Show();
            return(modal);
        }
Beispiel #5
0
        public static TrendModal CreateAndShow(float[] func, SeriesChartType type = SeriesChartType.Line)
        {
            var modal = new TrendModal(func, type);

            modal.Show();
            return(modal);
        }
Beispiel #6
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();
        }
Beispiel #7
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();
            }
        }