/// <summary> 
        /// Defines the initial settings for the window 
        /// control. In the very beginning, the window control needs 
        /// to know the view mode of the application form to perform 
        /// the right behavior for incoming mouse events on the 
        /// HALCON window.
        /// </summary>
        private void InteractiveForm_Load(object sender, System.EventArgs e)
        {
            String fileName = "patras";
            HImage image;

            viewController = new HWndCtrl(viewPort);
            roiController  = new ROIController();
            viewController.useROIController(roiController);
            viewController.setViewState(HWndCtrl.MODE_VIEW_NONE);

            try
            {
                image   = new HImage(fileName);
            }
            catch(HOperatorException)
            {
                MessageBox.Show("Problem occured while reading file!",
                    "InteractROIForm",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                return;
            }

            viewController.addIconicVar(image);
            viewController.repaint();
        }
Ejemplo n.º 2
0
        //

        /*************************************************************************
         * Eventhandles for the GUI components mapping the view functions, like
         * move, zoom and the neutral state.
         * /**************************************************************************/
        private void MoveButton_CheckedChanged(object sender, System.EventArgs e)
        {
            hWndControl.setViewState(HWndCtrl.MODE_VIEW_MOVE);
        }
        /********************************************************************/
        private void CalibrationForm_Load(object sender, System.EventArgs e)
        {
            mView = new HWndCtrl(viewPort);
            mView.setViewState(HWndCtrl.MODE_VIEW_NONE);
            mView.changeGraphicSettings(GraphicsContext.GC_DRAWMODE, comboBoxDraw.Text);
            mView.changeGraphicSettings(GraphicsContext.GC_LINEWIDTH, 1);

            mAssistant = new CalibrationAssistant();
            mAssistant.NotifyCalibObserver = new CalibDelegate(UpdateCalibResults);
            Init();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// In the beginning, some initialization tasks are performed. 
        /// The control instances, like ROIController and WindowController,
        /// are initialized and registered with each other. Also, the
        /// delegates of the models are linked to update methods
        /// to get notified about changes.
        /// </summary>
        public MatchingForm()
        {
            InitializeComponent();

            mView = new HWndCtrl(viewPort);

            createModelWindowMode = Color.RoyalBlue;
            trainModelWindowMode  = Color.Chartreuse;

            roiController = new ROIController();
            mView.useROIController(roiController);

            roiController.setROISign(ROIController.MODE_ROI_POS);

            mView.NotifyIconObserver = new IconicDelegate(UpdateViewData);
            roiController.NotifyRCObserver = new IconicDelegate(UpdateViewData);

            mView.setViewState(HWndCtrl.MODE_VIEW_NONE);

            locked = true;
            parameterSet = new MatchingParam();
            Init(parameterSet);
            locked = false;

            mAssistant = new MatchingAssistant(parameterSet);
            mAssistant.NotifyIconObserver  = new MatchingDelegate(UpdateMatching);
            mAssistant.NotifyParamObserver = new AutoParamDelegate(UpdateButton);

            speedOptHandler		= new MatchingOptSpeed(mAssistant, parameterSet);
            speedOptHandler.NotifyStatisticsObserver = new  StatisticsDelegate(UpdateStatisticsData);

            inspectOptHandler	= new MatchingOptStatistics(mAssistant, parameterSet);
            inspectOptHandler.NotifyStatisticsObserver = new  StatisticsDelegate(UpdateStatisticsData);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Loads MeasureForm and initializes view functions
        /// to include in the MeasureAssistant.
        /// </summary>
        private void MeasureForm_Load(object sender, System.EventArgs e)
        {
            mView = new HWndCtrl(viewPort);
            roiController = new ROIController();
            mView.useROIController(roiController);
            mAssistant = new MeasureAssistant(roiController);
            mShadow = new HXLDCont();

            mView.setViewState(HWndCtrl.MODE_VIEW_NONE);
            mView.changeGraphicSettings(GraphicsContext.GC_LINEWIDTH, 1);

            roiController.NotifyRCObserver = new IconicDelegate(UpdateROIData);
            mAssistant.NotifyMeasureObserver = new MeasureDelegate(UpdateMeasureResults);

            plotGraphWindow = new FunctionPlot(panelAxis, true);

              openImageFileDialog.InitialDirectory =
            (string)(HSystem.GetSystem("image_dir").TupleSplit(";"));
            Init();

            mView.setDispLevel(HWndCtrl.MODE_EXCLUDE_ROI);
        }