private void buttonIntervalRow_Click(object sender, EventArgs e) { if (ActiveMdiChild is FormChild) { FormChild activeChild = ActiveMdiChild as FormChild; double[] lefts, rights; int[] counts; StatisticsProcessor.ToIntervals(activeChild.DataAsRow, out lefts, out rights, out counts); int len = counts.Length; uint digits = lab1.Properties.Settings.Default.ShownDigits; string[] heads = new string[len]; for (int i = 0; i < len - 1; i++) { heads[i] = string.Format("[{0}; {1})", Math.Round(lefts[i], (int)digits), Math.Round(rights[i], (int)digits)); } heads[len - 1] = string.Format("[{0}; {1}]", Math.Round(lefts[len - 1], (int)digits), Math.Round(rights[len - 1], (int)digits)); activeChild.AddRow("Интервалы", heads); activeChild.AddRow("Кол-во эл-тов", counts); activeChild.AddRow(null, new char[] { '•' }); } }
private void buttonGroup_Click(object sender, EventArgs e) { if (ActiveMdiChild is FormChild) { FormChild activeChild = ActiveMdiChild as FormChild; int[] counts; double[] values; StatisticsProcessor.Groups(activeChild.DataAsRow, out counts, out values); activeChild.AddRow("Эл-тов в группе", counts); activeChild.AddRow("Значения", values); activeChild.AddRow(null, new char[] { '•' }); } }
private void buttonCheckRndUpDownSeries_Click(object sender, EventArgs e) { if (ActiveMdiChild is FormChild) { FormChild activeMdiChild = ActiveMdiChild as FormChild; char[] signs; int v, t; bool res = StatisticsProcessor.CheckRndUpDownSeries(activeMdiChild.DataAsRow, out signs, out v, out t); activeMdiChild.PrintLine("Выборка " + (res ? "" : "не") + "случайна, α=0,05. " + string.Format( "Серий: {0}, длина длинной: {1}", v, t), true); activeMdiChild.AddRow("Знаки", signs); } }
private void buttonSort_Click(object sender, EventArgs e) { if (ActiveMdiChild is FormChild) { FormChild activeChild = ActiveMdiChild as FormChild; double[] sortedData = activeChild.DataAsRow; Array.Sort <double>(sortedData); activeChild.AddRow("Сортировка", sortedData); DialogResult dlgResult = MessageBox.Show("Отдельно?", "Создать новую упорядоченную выборку?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlgResult == DialogResult.Yes) { FormChild formChild = new FormChild(sortedData); formChild.MdiParent = this; formChild.Text = string.Format("{0} ~ Упорядоченная", ActiveMdiChild.Text, childFormNumber++); formChild.Show(); } } }
private void buttonCheckOutstanding(object sender, EventArgs e) { if (ActiveMdiChild is FormChild) { FormChild activeMdiChild = ActiveMdiChild as FormChild; double[] clearData; double[] worthless = StatisticsProcessor.CheckOutstanding(activeMdiChild.DataAsRow, out clearData, 0.05f); if (worthless != null) { if (worthless.Length > 1) { activeMdiChild.PrintLine("Обнаружены резковыделяющиеся значения.", true); } else { activeMdiChild.PrintLine("Обнаружено резковыделяющееся значение: " + worthless[0].ToString(), true); } activeMdiChild.AddRow("Резковыделяющиеся значения:", worthless); DialogResult dlgResult = MessageBox.Show("Отдельно?", "Выделить значимые элементы в новую выборку?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlgResult == DialogResult.Yes) { FormChild formChild = new FormChild(clearData); formChild.MdiParent = this; formChild.Text = string.Format("{0} ~ {1}", activeMdiChild.Text, childFormNumber++); formChild.Show(); } } else { activeMdiChild.PrintLine("Выборка не засорена резковыделяющимися значениями.", true); } } }