Exemple #1
0
        void addFactorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                int        n     = arrSmp[0].GetLength();
                string     mark  = string.Format("x<SUB>{0}</SUB>", arrSmp.Length + 1);
                Sample     smp   = new Sample("Новый признак", mark, new double[n]);
                FactorForm fForm = new FactorForm(smp, "Нет");
                if (fForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                Sample[] arrSmpNew = new Sample[arrSmp.Length + 1];
                arrSmp.CopyTo(arrSmpNew, 0);
                arrSmpNew[arrSmp.Length] = fForm.GetSample();
                arrSmpNew[arrSmp.Length].DoHistogram(useSturgess);
                arrSmp = arrSmpNew;

                TranSample[] arrTranSmpNew = new TranSample[arrSmp.Length];
                arrTranSmp.CopyTo(arrTranSmpNew, 0);
                TranSample ts = fForm.GetTranSample();
                ts.DoHistogram(useSturgess);
                arrTranSmpNew[arrTranSmp.Length] = ts;
                arrTranSmp = arrTranSmpNew;

                lvSample.Items.Add(new ListViewItem(new string[] { ts.GetName(), ts.GetTransform() }));
            }
            catch { }
        }
Exemple #2
0
 void editFactorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         int        index = lvSample.SelectedIndices[0];
         string     tr    = lvSample.Items[index].SubItems[1].Text;
         FactorForm fForm = new FactorForm(arrSmp[index], tr);
         if (fForm.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         arrSmp[index] = fForm.smp;
         Sample ts = (fForm.smp.Clone() as Sample);
         ts.Transform(fForm.tr);
         arrTSmp[index] = ts;
         lvSample.Items[index].SubItems[0].Text = arrSmp[index].name;
         lvSample.Items[index].SubItems[1].Text = fForm.tr;
     }
     catch { }
 }
Exemple #3
0
        void editFactorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                int        index     = lvSample.SelectedIndices[0];
                string     transform = lvSample.Items[index].SubItems[1].Text;
                FactorForm fForm     = new FactorForm(arrSmp[index], transform);
                if (fForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                arrSmp[index] = fForm.GetSample();
                TranSample ts = fForm.GetTranSample();
                ts.DoHistogram(useSturgess);
                arrTranSmp[index] = ts;

                lvSample.Items[index].SubItems[0].Text = arrSmp[index].GetName();
                lvSample.Items[index].SubItems[1].Text = ts.GetTransform();
            }
            catch { }
        }