public void Init(BaseUCDisplayCamera baseUCDisplayCamera)
        {
            try
            {
                if (g_BaseUCDisplayCamera != null)
                {
                    return;
                }
                BaseParSetDisplay baseParSetDisplay = null;
                switch (baseUCDisplayCamera.NoCamera)
                {
                case 1:
                    g_BaseUCDisplayCamera = new UCDisplayCamera1(false);
                    baseParSetDisplay     = ParSetDisplay.P_I["Camera1"];
                    break;

                case 2:
                    g_BaseUCDisplayCamera = new UCDisplayCamera2(false);
                    baseParSetDisplay     = ParSetDisplay.P_I["Camera2"];
                    break;

                case 3:
                    g_BaseUCDisplayCamera = new UCDisplayCamera3(false);
                    baseParSetDisplay     = ParSetDisplay.P_I["Camera3"];
                    break;

                case 4:
                    g_BaseUCDisplayCamera = new UCDisplayCamera4(false);
                    baseParSetDisplay     = ParSetDisplay.P_I["Camera4"];
                    break;

                case 5:
                    g_BaseUCDisplayCamera = new UCDisplayCamera5(false);
                    baseParSetDisplay     = ParSetDisplay.P_I["Camera5"];
                    break;

                case 6:
                    g_BaseUCDisplayCamera = new UCDisplayCamera6(false);
                    baseParSetDisplay     = ParSetDisplay.P_I["Camera6"];
                    break;
                }
                //窗口的显示参数
                g_BaseUCDisplayCamera.Init(baseParSetDisplay);

                g_BaseUCDisplayCamera.HorizontalAlignment = HorizontalAlignment.Stretch;
                g_BaseUCDisplayCamera.VerticalAlignment   = VerticalAlignment.Stretch;
                g_BaseUCDisplayCamera.Margin = new Thickness(2, 2, 2, 2);
                gdRoot.Children.Add(g_BaseUCDisplayCamera);

                //同步本地图像
                g_BaseUCDisplayCamera.BlLocalImage       = baseUCDisplayCamera.BlLocalImage;
                g_BaseUCDisplayCamera.g_PathLocalImage_L = baseUCDisplayCamera.g_PathLocalImage_L;
                g_BaseUCDisplayCamera.NoLocalImage       = baseUCDisplayCamera.NoLocalImage;
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError(NameClass, ex);
            }
        }
 private void BaseMetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         if (g_BaseUCDisplayCamera != null)
         {
             g_BaseUCDisplayCamera.RecoverPhotoOnly_Invoke();
             g_BaseUCDisplayCamera = null;
         }
         g_WinCameraROI = null;
     }
     catch (Exception ex)
     {
         Log.L_I.WriteError(NameClass, ex);
     }
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.baseUCDisplay = ((Camera.BaseUCDisplayCamera)(target));
                return;

            case 2:
                this.gpbCamera = ((ControlLib.NGroupBox)(target));

            #line 36 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.gpbCamera.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.gpbCamera_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 3:
                this.dpImage = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 4:
                this.svImage = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 5:
                this.ccImage = ((System.Windows.Controls.ContentControl)(target));
                return;

            case 6:
                this.imDisplay = ((System.Windows.Controls.Image)(target));
                return;

            case 7:
                this.cvDraw = ((System.Windows.Controls.Canvas)(target));

            #line 44 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.cvDraw.MouseMove += new System.Windows.Input.MouseEventHandler(this.cvDraw_MouseMove);

            #line default
            #line hidden
                return;

            case 8:
                this.hWDispImage = ((HalconDotNet.HWindowControlWPF)(target));
                return;

            case 9:
                this.ppShowResult = ((System.Windows.Controls.Primitives.Popup)(target));
                return;

            case 10:
                this.txtInfo = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.dpBtn = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 12:
                this.lblTactTime = ((ControlLib.NLabel)(target));
                return;

            case 13:
                this.lblRealImage = ((ControlLib.NLabel)(target));

            #line 62 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.lblRealImage.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.lblRealImage_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 14:
                this.lblSaveImage = ((ControlLib.NLabel)(target));

            #line 64 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.lblSaveImage.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.lblSaveImage_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 15:
                this.lblLocalImage = ((ControlLib.NLabel)(target));

            #line 65 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.lblLocalImage.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.lblLocalImage_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 16:
                this.lblNext = ((ControlLib.NLabel)(target));

            #line 67 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.lblNext.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.lblNext_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 17:
                this.lblPre = ((ControlLib.NLabel)(target));

            #line 70 "..\..\..\..\UICamera\Base\BaseUCDisplayCamera.xaml"
                this.lblPre.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.lblPre_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 18:
                this.lblPosGray = ((ControlLib.NLabel)(target));
                return;

            case 19:
                this.lblPop = ((ControlLib.NLabel)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public virtual void BaseMetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     g_BaseUCDisplayCamera.RecoverPhoto_Invoke();
     g_BaseUCDisplayCamera = null;
 }
示例#5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 10 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                ((Main.UCSetSample)(target)).Loaded += new System.Windows.RoutedEventHandler(this.UserControl_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.scrollViewer = ((System.Windows.Controls.ScrollViewer)(target));

            #line 26 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.scrollViewer.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.ScrollViewer_PreviewMouseWheel);

            #line default
            #line hidden
                return;

            case 3:
                this.dgResult = ((System.Windows.Controls.DataGrid)(target));

            #line 29 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.dgResult.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.DgResult_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 4:
                this.ucSetDisplay = ((Camera.BaseUCDisplayCamera)(target));
                return;

            case 5:
                this.lblDefect = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.btnLoadImg = ((System.Windows.Controls.Button)(target));

            #line 57 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.btnLoadImg.Click += new System.Windows.RoutedEventHandler(this.BtnLoadImg_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.btnSaveParams = ((System.Windows.Controls.Button)(target));

            #line 58 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.btnSaveParams.Click += new System.Windows.RoutedEventHandler(this.BtnSaveParams_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.btnNextImg = ((System.Windows.Controls.Button)(target));

            #line 59 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.btnNextImg.Click += new System.Windows.RoutedEventHandler(this.BtnNextImg_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.cbSide = ((System.Windows.Controls.ComboBox)(target));

            #line 60 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.cbSide.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.CbSide_SelectionChanged);

            #line default
            #line hidden
                return;

            case 10:
                this.btnTestImg = ((System.Windows.Controls.Button)(target));

            #line 64 "..\..\..\..\Sample\UI\UCSetSample.xaml"
                this.btnTestImg.Click += new System.Windows.RoutedEventHandler(this.BtnTestImg_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.scrollViewer = ((System.Windows.Controls.ScrollViewer)(target));

            #line 20 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.scrollViewer.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.ScrollViewer_PreviewMouseWheel);

            #line default
            #line hidden
                return;

            case 2:
                this.dgResult = ((System.Windows.Controls.DataGrid)(target));

            #line 23 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.dgResult.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.DgResult_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 3:
                this.ucSampleDisplay = ((Camera.BaseUCDisplayCamera)(target));
                return;

            case 4:
                this.ucLocalDisplay = ((Camera.BaseUCDisplayCamera)(target));
                return;

            case 5:
                this.lblSampleDefect = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.lblLocalDefect = ((System.Windows.Controls.Label)(target));

            #line 56 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.lblLocalDefect.Loaded += new System.Windows.RoutedEventHandler(this.LblLocalDefect_Loaded);

            #line default
            #line hidden
                return;

            case 7:
                this.cbSide = ((System.Windows.Controls.ComboBox)(target));

            #line 65 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.cbSide.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.CbSide_SelectionChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.btnLoadSample = ((System.Windows.Controls.Button)(target));

            #line 69 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.btnLoadSample.Click += new System.Windows.RoutedEventHandler(this.BtnLoadSample_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.btnComPareSample = ((System.Windows.Controls.Button)(target));

            #line 70 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.btnComPareSample.Click += new System.Windows.RoutedEventHandler(this.BtnComPareSample_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.btnNext = ((System.Windows.Controls.Button)(target));

            #line 71 "..\..\..\..\Sample\UI\UCCompareSample.xaml"
                this.btnNext.Click += new System.Windows.RoutedEventHandler(this.BtnNext_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }