public TestResult(int tests_number, Dictionary <char, List <Bitmap> > unsolved_test_set, Dictionary <char, List <Bitmap> > error_test_set) { if (unsolved_test_set == null || error_test_set == null || tests_number < 1) { throw new Exception(); } int unsolved_tests_count = 0; foreach (var list in unsolved_test_set.Values) { unsolved_tests_count += list.Count; } int error_tests_count = 0; foreach (var list in error_test_set.Values) { error_tests_count += list.Count; } int solved_tests_count = tests_number - (unsolved_tests_count + error_tests_count); if (solved_tests_count < 0) { throw new Exception(); } InitializeComponent(); label5.Text = tests_number.ToString(); label6.Text = unsolved_tests_count.ToString(); label7.Text = (unsolved_tests_count / (double)(tests_number)).ToString(); label8.Text = error_tests_count.ToString(); label9.Text = (error_tests_count / (double)(tests_number)).ToString(); if (unsolved_tests_count > 0) { unsolvedSetViewer = new StudySetViewer(unsolved_test_set); unsolvedSetViewer.remove_button_enable = false; unsolvedSetViewer.Text = "Unsolved Set"; } else { button1.Visible = false; } if (error_tests_count > 0) { errorSetViewer = new StudySetViewer(error_test_set); errorSetViewer.remove_button_enable = false; errorSetViewer.Text = "Error Set"; } else { button2.Visible = false; } }
public Form1() { InitializeComponent(); pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); pictureBox2.Image = new Bitmap(pictureBox2.Width, pictureBox2.Height); openFileDialog1.InitialDirectory = Environment.CurrentDirectory; openFileDialog1.Filter = "jpg files (*.jpg)|*.jpg|" + "png files (*.png)|*.png|" + "All files (*.*)|*.*"; openFileDialog1.FilterIndex = 1; openFileDialog1.RestoreDirectory = true; openFileDialog1.Multiselect = false; saveFileDialog1.InitialDirectory = Environment.CurrentDirectory; saveFileDialog1.Filter = "jpg files (*.jpg)|*.jpg|" + "png files (*.png)|*.png|" + "All files (*.*)|*.*"; saveFileDialog1.FilterIndex = 1; saveFileDialog1.RestoreDirectory = true; openFileDialog2.InitialDirectory = Environment.CurrentDirectory; openFileDialog2.Filter = "perceptron files (*.pcptrn)|*.pcptrn"; openFileDialog2.FilterIndex = 1; openFileDialog2.RestoreDirectory = true; openFileDialog2.Multiselect = false; saveFileDialog2.InitialDirectory = Environment.CurrentDirectory; saveFileDialog2.Filter = "perceptron files (*.pcptrn)|*.pcptrn"; saveFileDialog2.FilterIndex = 1; saveFileDialog2.RestoreDirectory = true; folderBrowserDialog1.SelectedPath = Environment.CurrentDirectory; fontDialog1.Font = new Font("Arial", 40f); studySetViewer = new StudySetViewer(study_set); parametersSeter = new PerceptronParametersSeter(studySetViewer); }
public PerceptronParametersSeter(StudySetViewer studySetViewer) { InitializeComponent(); parameters = new Parameters(); this.studySetViewer = studySetViewer; }