private void rowBtn_Click(object sender, EventArgs e)
 {
     if (saveFileDialog.ShowDialog() == DialogResult.OK)
     {
         Models.DataGenerator.WriteToFileData(dv.GetVariationSeries(), saveFileDialog.FileName);
     }
     this.Close();
 }
        public void UpdateInterface()
        {
            if (discreteVariable != null && !isCalculated)
            {
                // calc 1 tab
                volumeLbl.Text = discreteVariable.Size.ToString();
                rowTb.Text     = string.Join(" ", discreteVariable.GetVariationSeries());
                System.Collections.Generic.KeyValuePair <double, int>[] table = discreteVariable.GetStatisticalTable();

                statTableDgv.Rows.Add();
                statTableDgv.Rows.Add();
                statTableDgv[statTableDgv.ColumnCount - 1, 0].Value = "x";
                statTableDgv[statTableDgv.ColumnCount - 1, 1].Value = "n";
                foreach (var item in table)
                {
                    statTableDgv.ColumnCount += 1;
                    statTableDgv[statTableDgv.ColumnCount - 1, 0].Value = item.Key.ToString();
                    statTableDgv[statTableDgv.ColumnCount - 1, 1].Value = item.Value.ToString();
                }
                // calc 2 tab
                medianaLbl.Text = discreteVariable.Me.ToString();
                modaLbl.Text    = string.Join(" ", discreteVariable.Mo);
                averageLbl.Text = discreteVariable._x.ToString();

                // calc 3 tab
                devLbl.Text       = discreteVariable.Dev.ToString();
                dfLbl.Text        = discreteVariable.d_f.ToString();
                variansaLbl.Text  = discreteVariable.s2.ToString();
                standartLbl.Text  = discreteVariable.s.ToString();
                spreadLbl.Text    = discreteVariable.p.ToString();
                variationLbl.Text = discreteVariable.V.ToString();

                // calc 4 tab
                // nothing to calc
                // its interquantility latitudes, that are calculated dynamicly

                // calc 5 tab
                m1Lbl.Text = discreteVariable.mh(1).ToString();
                m2Lbl.Text = discreteVariable.mh(2).ToString();
                m3Lbl.Text = discreteVariable.mh(3).ToString();
                m4Lbl.Text = discreteVariable.mh(4).ToString();

                Moment1Lbl.Text = discreteVariable.Mh(1).ToString();
                Moment2Lbl.Text = discreteVariable.Mh(2).ToString();
                Moment3Lbl.Text = discreteVariable.Mh(3).ToString();
                Moment4Lbl.Text = discreteVariable.Mh(4).ToString();

                // calc 6 tab
                assymetricLbl.Text = discreteVariable.As.ToString();
                eksLbl.Text        = discreteVariable.Ek.ToString();

                isCalculated = true;
            }
        }