public Form1() { InitializeComponent(); this.Height = 700; this.Width = 1106; Vulkaniums Vulk_data = new Vulkaniums(); col_vulk = Vulk_data.col_vulkans; Vulk_data.coord_vulkans(); vulkan_markers = new one_vulkan[col_vulk]; vulkans_name = Vulk_data.vulkans_name(1); vulkans_koord = Vulk_data.coord_vulkans(); Vulk_data.group_priznak(); Vulk_data.priz_group_mass(1); for (int i = 0; i < col_vulk; i++) { // MessageBox.Show(vulkans_koord[i, 1].ToString() + "|||" + vulkans_koord[i, 0].ToString()); int[] location_vulk = inProg(vulkans_koord[i, 1], vulkans_koord[i, 0]); one_vulkan vul = new one_vulkan(vulkans_name[i], location_vulk[0], location_vulk[1]); vulkan_markers[i] = vul; this.panel1.Controls.Add(vulkan_markers[i]); vul.Location = vulkan_markers[i].locat; } V_CHB = new Vulk_chackbox(vulkan_markers, vulkans_name, col_vulk); P_CHB = new priznak_checkbox(0, true); this.panel2.Controls.Add(V_CHB); }
private void button1_Click(object sender, EventArgs e) { Vulkaniums newdata = new Vulkaniums(); raspozn jb = new raspozn(); int[,] pri = newdata.vulkan_priznak(); int[] id_priz_checked = P_CHB.get_priznak(); int[] vulk = new int[id_priz_checked.Length]; // string red = ""; int ki = 0; for (int i = 0; i < newdata.col_priznak; i++) { for (int j = 0; j < id_priz_checked.Length; j++) { if (i == id_priz_checked[j]) { // red += i + " znach=" + pri[this.comboBox1.SelectedIndex, i]+" "; vulk[ki] = pri[this.comboBox1.SelectedIndex, i]; ki++; } } } MessageBox.Show(table_v.get_gr()[0] + " " + table_v.get_gr()[1] + " " + table_v.get_gr()[2]); richTextBox1.Text = jb.srart(table_v.get_matrix(id_priz_checked), table_v.get_gr(), vulk); }
public Database() { InitializeComponent(); this.Height = 615; Vulkaniums newdata = new Vulkaniums(); string[] vulk_name = newdata.vulkans_name(1); comboBox1.Items.AddRange(vulk_name); this.comboBox1.SelectedIndex = 0; }
public raspozn_job() { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); string[] vulk_name = newdata.vulkans_name(1); comboBox1.Items.AddRange(vulk_name); this.comboBox1.SelectedIndex = 0; this.comboBox2.SelectedIndex = 0; this.panel1.Controls.Add(table_v); this.Height = 550; }
private int[,] create_matrix_v_p() { int[] id_vulk_checked = V_CHB.get_vulk(); int[] id_priz_checked = P_CHB.get_priznak(); int[,] result = new int[V_CHB.col_vulk_checked, P_CHB.col_priz_checked]; martix_sopostavimosti_vulk = new int[V_CHB.col_vulk_checked]; martix_sopostavimosti_prizn = new int[P_CHB.col_priz_checked]; //MessageBox.Show("col_vulk_checked " + martix_sopostavimosti_vulk.Length + " col_priz_checked " + martix_sopostavimosti_prizn.Length); int count_vul = 0, count_prizn = 0; Vulkaniums Vulk_data = new Vulkaniums(); string red = ""; int[,] mer = Vulk_data.vulkan_priznak(); for (int i = 0; i < Vulk_data.col_vulkans; i++) { bool fl = false; for (int j = 0; j < V_CHB.col_vulk_checked; j++) { if (i == id_vulk_checked[j]) { fl = true; break; } } if (fl == true) { count_prizn = 0; martix_sopostavimosti_vulk[count_vul] = i; for (int k = 0; k < Vulk_data.col_priznak; k++) { bool fl_2 = false; for (int j = 0; j < P_CHB.col_priz_checked; j++) { if (k == id_priz_checked[j]) { fl_2 = true; break; } } if (fl_2 == true) { martix_sopostavimosti_prizn[count_prizn] = k; result[count_vul, count_prizn] = mer[i, k]; red += mer[i, k]; count_prizn++; } } count_vul++; } } return(result); }
public grup_priz_table() { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); string[] gr_name = newdata.priz_group_mass(1); for (int i = 0; i < newdata.col_grupp; i++) { dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = i + 1; dataGridView1.Rows[i].Cells[1].Value = gr_name[i]; } }
public vulkans_table() { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); string[] vulk_name = newdata.vulkans_name(1); for (int i = 0; i < newdata.col_vulkans; i++) { dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = i + 1; dataGridView1.Rows[i].Cells[1].Value = vulk_name[i]; } }
public priz_for_vulk_table(int num) { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); int[,] priz = newdata.vulkan_priznak(); string[] name = newdata.priz_group_mass(); for (int i = 0; i < newdata.col_priznak; i++) { dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = name[i]; dataGridView1.Rows[i].Cells[1].Value = priz[num, i]; } }
public fractoin_table() { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); //////////////////a List <List <int> > frac = newdata.get_area("a"); int i = 0; foreach (List <int> stroka in frac) { string red = ""; foreach (int el in stroka) { red += el + " "; } dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = "a"; dataGridView1.Rows[i].Cells[1].Value = red; i++; } ////////////////b frac = newdata.get_area("b"); foreach (List <int> stroka in frac) { string red = ""; foreach (int el in stroka) { red += el + " "; } dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = "b"; dataGridView1.Rows[i].Cells[1].Value = red; i++; } ///////////////////y frac = newdata.get_area("y"); foreach (List <int> stroka in frac) { string red = ""; foreach (int el in stroka) { red += el + " "; } dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = "y"; dataGridView1.Rows[i].Cells[1].Value = red; i++; } }
public priznak_table() { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); string[] priz_name = newdata.priz_group_mass(); int col_prizn = newdata.col_priznak; for (int i = 0; i < col_prizn; i++) { dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = i + 1; dataGridView1.Rows[i].Cells[1].Value = priz_name[i]; } }
public sootv_gr_pr_table() { InitializeComponent(); Vulkaniums newdata = new Vulkaniums(); List <List <int> > gr_pr = newdata.group_priznak_2(); int i = 0, k = 1; foreach (List <int> stroka in gr_pr) { string red = ""; foreach (int el in stroka) { red += el + " "; } dataGridView1.RowCount++; dataGridView1.Rows[i].Cells[0].Value = "Группа №" + (i + 1); dataGridView1.Rows[i].Cells[1].Value = red; i++; } }
private bool check_m(int[,] mer, int[,] all) { string red = "", red_2 = ""; Vulkaniums Vulk_data = new Vulkaniums(); for (int i = 0; i < Vulk_data.col_vulkans; i++) { for (int j = 0; j < Vulk_data.col_priznak; j++) { red += mer[i, j]; red_2 += all[i, j]; // if (mer[i,j]!=all[i,j]) // return false; } red += "\n"; red_2 += "\n"; } MessageBox.Show(red + "\n\n" + red_2); return(true); }
public priznak_checkbox(int el, bool fl) { InitializeComponent(); Vulkaniums Vulk_data = new Vulkaniums(); int[,] grup_priznak = Vulk_data.group_priznak(); string[] priz_name = Vulk_data.priz_group_mass(); string[] grup_name = Vulk_data.priz_group_mass(1); col_priz_in_gr = Vulk_data.col_priz_in_grupp(); int now_col = col_priz_in_gr[0]; col_prizn = Vulk_data.col_priznak; col_grup = Vulk_data.col_grupp; index_grupp = new int[col_grup]; int k = 0; bool flag_gr = true; for (int i = 0; i < col_prizn; i++) { if (i >= now_col && flag_gr == false) { k++; now_col += col_priz_in_gr[k]; flag_gr = true; } if (i < now_col && flag_gr == true) { this.checkedListBox1.Items.Add("__ГРУППА№" + (k + 1).ToString() + " " + grup_name[k], true); index_grupp[k] = this.checkedListBox1.Items.Count - 1; // MessageBox.Show(index_grupp[k].ToString()); flag_gr = false; } this.checkedListBox1.Items.Add((i + 1).ToString() + " " + priz_name[i], fl); checkedListBox1.SetItemChecked(i, fl); } if (el == 1) { checkedListBox1.Height = 250; } }
public int[,] get_matrix(int [] priznaki) { Vulkaniums newdata = new Vulkaniums(); int col_need = 0, gr1 = 0, gr2 = 0, gr3 = 0; for (int i = 0; i < newdata.col_vulkans; i++) { if (dataGridView1.Rows[i].Cells[2].Value.ToString() == "1") { gr1++; } if (dataGridView1.Rows[i].Cells[3].Value.ToString() == "1") { gr2++; } if (dataGridView1.Rows[i].Cells[4].Value.ToString() == "1") { gr3++; } } col_need = gr1 + gr2 + gr3; gr[0] = gr1; gr[1] = gr2; gr[2] = gr3; int[,] matrix = new int[col_need, priznaki.Length], data = newdata.vulkan_priznak(); matrix_sootv = new int[col_need]; string red = ""; //1gr int K = 0, jk = 0; // MessageBox.Show((gr1 + gr2 + gr3) + " ll " + gr1 + gr2 + gr3); for (int i = 0; i < newdata.col_vulkans; i++) { if (dataGridView1.Rows[i].Cells[2].Value.ToString() == "1") { for (int j = 0; j < newdata.col_priznak; j++) { for (int jo = 0; jo < priznaki.Length; jo++) { if (j == priznaki[jo]) { matrix[K, jk] = data[i, j]; red += data[i, j] + " "; jk++; } } } matrix_sootv[K] = i; red += "\n"; K++; jk = 0; } } //gr 2 for (int i = 0; i < newdata.col_vulkans; i++) { if (dataGridView1.Rows[i].Cells[3].Value.ToString() == "1") { for (int j = 0; j < newdata.col_priznak; j++) { for (int jo = 0; jo < priznaki.Length; jo++) { if (j == priznaki[jo]) { matrix[K, jk] = data[i, j]; red += data[i, j] + " "; jk++; } } } matrix_sootv[K] = i; red += "\n"; K++; jk = 0; } } //gr 3 for (int i = 0; i < newdata.col_vulkans; i++) { if (dataGridView1.Rows[i].Cells[4].Value.ToString() == "1") { for (int j = 0; j < newdata.col_priznak; j++) { for (int jo = 0; jo < priznaki.Length; jo++) { if (j == priznaki[jo]) { matrix[K, jk] = data[i, j]; red += data[i, j] + " "; jk++; } } } matrix_sootv[K] = i; red += "\n"; K++; jk = 0; } } MessageBox.Show(red); return(matrix); }