private void button1_Click(object sender, EventArgs e) { if (Double.TryParse(textBox1.Text, out double result)) { if (Int32.TryParse(textBox2.Text, out int result2)) { dbscan1 = new DBScan(data, labels, chart1); dbscan1.StartDBScan(comboBox1.SelectedIndex, comboBox2.SelectedIndex, Convert.ToDouble(textBox1.Text), Convert.ToInt32(textBox2.Text)); button2.Enabled = true; button4.Enabled = true; dbscan1.PrintChart(comboBox1.SelectedIndex, comboBox2.SelectedIndex); } else if (textBox2.Text == "") { MessageBox.Show("Lutfen minimum nokta sayısını boş bırakmayınız", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Lutfen minimum nokta sayısını tam sayi olarak giriniz", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (textBox1.Text == "") { MessageBox.Show("Lutfen epsilon değerini boş bırakmayınız", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("Lutfen epsilon değerini (x,xx...) yada (x.xx..) olarak giriniz", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button3_Click(object sender, EventArgs e) { OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.ShowDialog(); if (fileDialog.FileName != "") { data = DBScan.ReadData(fileDialog.FileName); labels = DBScan.ReadLabel(fileDialog.FileName); comboBox1.Items.Clear(); comboBox2.Items.Clear(); foreach (string s in labels) { comboBox1.Items.Add(s); comboBox2.Items.Add(s); } comboBox1.SelectedIndex = 0; comboBox2.SelectedIndex = 1; button1.Enabled = true; button2.Enabled = false; label5.Text = "Dosya : " + fileDialog.SafeFileName; } }