Exemple #1
0
        private void DisableControls()
        {
            this.dataGridView.Rows.Clear();
            this.dataGridView.Columns.Clear();
            this.schema       = null;
            this.generator    = null;
            this.docImageForm = null;

            this.openToolStripMenuItem.Enabled              = true;
            this.newRowToolStripMenuItem.Enabled            = false;
            this.loadFSCToolStripMenuItem.Enabled           = false;
            this.removeRowToolStripMenuItem.Enabled         = false;
            this.addallresultcasesToolStripMenuItem.Enabled = false;
            this.addAllUserResultsToolStripMenuItem.Enabled = false;
            this.addResultsToolStripMenuItem.Enabled        = false;
            this.classifyToolStripMenuItem.Enabled          = false;
            this.closeToolStripMenuItem.Enabled             = false;
            this.removeRowToolStripMenuItem1.Enabled        = false;
            this.removeRowToolStripMenuItem.Enabled         = false;
            this.saveDebugInfoToolStripMenuItem.Enabled     = false;
            this.clearDebugInfoToolStripMenuItem.Enabled    = false;
            this.viewToolStripMenuItem.Enabled              = false;
            this.extrasToolStripMenuItem.Enabled            = false;
            this.actionToolStripMenuItem1.Enabled           = false;
            this.hRTMapperToolStripMenuItem.Visible         = false;
            this.listBoxStatus.Enabled = true;
            this.listBoxStatus.Items.Clear();
            this.progressBarState.Value = 0;
        }
Exemple #2
0
        private void LoadFSCfromDocumentToolStripMenuItem_Click(
            object sender,
            EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            this.dataGridView.Rows.Clear();

            this.openFileDialog.Filter   = C45Constants.FILTER_IMAGES;
            this.openFileDialog.FileName = String.Empty;
            this.openFileDialog.ShowDialog();

            if (this.openFileDialog.FileName != String.Empty)
            {
                HRTFeaturesSetGenerator.OCRProgress += new HRTFeaturesSetGenerator.OCRProgressEventHandler(HRTFeaturesSetGenerator_OCRProgress);
                this.generator = new HRTFeaturesSetGenerator(this.openFileDialog.FileName);

                if (documentImageToolStripMenuItem.CheckState == CheckState.Checked)
                {
                    this.LoadDocumentImageForm();
                    docImageForm.ModiDocument = this.generator.ModiDocument;
                    docImageForm.Lines        = this.generator.Lines;
                    docImageForm.Show();
                }

                if (this.textBoxToolStripMenuItem1.CheckState == CheckState.Checked)
                {
                    this.listBoxText.Visible   = true;
                    this.listBoxStatus.Visible = false;
                }

                if (this.statusBoxToolStripMenuItem.CheckState == CheckState.Checked)
                {
                    this.listBoxText.Visible   = false;
                    this.listBoxStatus.Visible = true;
                }

                this.progressBarState.Value = 100;
                this.labelState.Text        = "OCR recognition finished";

                foreach (C45FeatureSet fs in generator.FeatureSetCollection)
                {
                    this.featureSetCollection.Add(fs);
                }

                this.generator.SaveDocInformationAsText(Path.GetFileName(this.openFileDialog.FileName) + @".txt");

                this.SetEventHandler();
                this.RestoreDataGridView();
                this.FillTextListBox();
            }
            this.Cursor = Cursors.Default;
        }