Пример #1
0
 private void RefreshParameters()
 {
     listBox1.Items.Clear();
     listBox2.Items.Clear();
     listBox3.Items.Clear();
     attributes_ = classifier_.getAttributes();
     classes_    = classifier_.getClasses();
     childs_     = classifier_.getChilds();
     foreach (DSAttributeWrapper at in attributes_)
     {
         listBox1.Items.Add(at.getName());
     }
     foreach (DSClassWrapper cl in classes_)
     {
         listBox3.Items.Add(cl.getName());
     }
     foreach (DSClassifierWrapper ch in childs_)
     {
         listBox2.Items.Add(ch.getName());
     }
     numericUpDown1.Value = classifier_.getLevel();
     foreach (DataRow dr in dt_types.Rows)
     {
         if (dr["ID"].ToString() == classifier_.getType())
         {
             comboBox1.SelectedValue = dr["ID"].ToString();
         }
     }
     BuildTrainingSetTable(dataGridView1);
     BuildBaseObjectTable(dataGridView2);
 }
Пример #2
0
        public void ReadClassifierTable()
        {
            for (int i = com.DictionaryAttributes() + com.DictionaryClasses(); i < com.DictionaryElements(); i++)
            {
                classifier.Add(com.GetNumber(i));
            }

            List <DSClassifierWrapper> classifiers = hierarchy_.getClassifiers();

            foreach (string cl in classifier)
            {
                DataTable  dt22 = new DataTable();
                DataColumn column;
                DataRow    row;

                DSClassifierWrapper classifier_ = classifiers[classifier.IndexOf(cl)];

                dt22.TableName = "dat" + classifier.IndexOf(cl);

                column            = new DataColumn();
                column.ColumnName = "Класс";
                dt22.Columns.Add(column);


                column            = new DataColumn();
                column.ColumnName = "Степень принадлежности";
                dt22.Columns.Add(column);

                tabpage1 = new TabPage();
                tabpage1.SuspendLayout();
                tabpage1.Name = cl;
                tabControl1.TabPages.Add(tabpage1);
                tabControl1.SelectedTab = tabpage1;
                tabpage1.Text           = cl.ToString();

                DGV                    = new DataGridView();
                DGV.Name               = "DataGridV" + classifier.IndexOf(cl);
                DGV.BackgroundColor    = Color.White;
                DGV.Parent             = tabpage1;
                DGV.Location           = new Point(7, 7);
                DGV.Size               = new Size(299, 162);
                DGV.BorderStyle        = BorderStyle.FixedSingle;
                DGV.Visible            = true;
                DGV.AllowUserToAddRows = false;
                DGV.ReadOnly           = true;



                foreach (DSClassWrapper cls in classifier_.getClasses())
                {
                    foreach (DataRow dr in dtClasses.Rows)
                    {
                        if ((cls.getID() + " " + cls.getName()) == dr["Класс"].ToString())
                        {
                            row          = dt22.NewRow();
                            row["Класс"] = dr["Класс"];
                            dt22.Rows.Add(row);
                        }
                    }
                }

                DGV.DataSource = dt22;
                datatable.Add(dt22);
                tabControl1.TabPages[cl].Controls.Add(DGV);

                tabpage1.ResumeLayout();
                tabpage1.Refresh();
            }
        }