Пример #1
0
		public OCRStageWidget(MainRecognizerWindow window)
			: base(window)
		{
			Glade.XML gxml = new Glade.XML("mathtextrecognizer.glade",
			                               "ocrStageWidgetBase");

			gxml.Autoconnect(this);
			
			this.Add(ocrStageWidgetBase);
			
			
			// We load the contextual menu.
			gxml = new Glade.XML("mathtextrecognizer.glade", 
			               "segmentedNodeMenu");
			
			gxml.Autoconnect(this);
			
			
			controller = new OCRController();
			
			// Asignamos los eventos que indican que se han alcanzado hitos
			// en el reconocimiento de un cáracter.
			controller.MessageLogSent += 
				new MessageLogSentHandler(OnControllerMessageLogSent);
			
			controller.NodeBeingProcessed += 
				new NodeBeingProcessedHandler(OnControllerNodeBeingProcessed);
			    		
			controller.ProcessFinished += OnControllerProcessFinished;
			    
			controller.BitmapProcessedByDatabase +=
			    new BitmapProcessedHandler(OnControllerBitmapProcessedByDatabase);
			
			InitializeWidgets();
		}
		public BlackboardStageWidget(MainRecognizerWindow parent)
			: base(parent)
		{
			Glade.XML gladeXml = new XML("mathtextrecognizer.glade",
			                             "unassistedStageWidgetBase");
			
			gladeXml.Autoconnect(this);
			
			gladeXml = new XML("mathtextrecognizer.glade",
			                   "blackboardMenu");
			
			gladeXml.Autoconnect(this);
			
			this.Add(unassistedStageWidgetBase);
			
			ocrController = new OCRController();
			ocrController.MessageLogSent += 
				new MessageLogSentHandler(OnControllerMessageLogSent);
			
			ocrController.ProcessFinished += 
				new EventHandler(OnOCRControllerProcessFinished);
			ocrController.NodeBeingProcessed += 
				new NodeBeingProcessedHandler(OnControllerStepDone);
					
			tokenizingController = new TokenizingController();
			tokenizingController.MessageLogSent += 
				new MessageLogSentHandler(OnControllerMessageLogSent);
			tokenizingController.ProcessFinished += 
				new EventHandler(OnTokenizingControllerProcessFinished);
			tokenizingController.NodeBeingProcessed += 
				new NodeBeingProcessedHandler(OnControllerStepDone);
			
			parsingController = new ParsingController();
			parsingController.MessageLogSent += 
				new MessageLogSentHandler(OnControllerMessageLogSent);
			parsingController.Matching += 
				new MatchingHandler(OnControllerStepDone);
			
			parsingController.ProcessFinished +=
				new EventHandler(OnParsingControllerProcessFinished);
			
			InitializeWidgets();
			
			tokenizingFinished = false;
			
			this.ShowAll();
		}