public void AddHistogram (Histogram histogram) { GroupBox groupBox = new GroupBox(); MainPanel.Children.Add(groupBox); groupBox.Header = "Xray Image " + MainPanel.Children.Count.ToString(); groupBox.Content = histogram; }
private void CreateXRayDisplays () { List<ViewObject> views = GetImageData(); if (views.Count > 0) { L3.Cargo.Workstation.Plugins.XRayImageBase.XRayImages xrayview = new L3.Cargo.Workstation.Plugins.XRayImageBase.XRayImages(); m_XrayImage = xrayview.CreateImages(views, m_statusBarItems, m_CaseObj.CaseHistories, m_SysConfig); xrayview.AlgServerRequestEvent += new AlgServerRequestEventHandler(xrayview_AlgServerRequestEvent); foreach (XRayImage image in m_XrayImage) { image.SetCreateNewAnnotation(m_CaseObj.IsCaseEditable); XRayView xrayView = image.MainView; Histogram histogram = new Histogram(); histogram.Setup(xrayView.XrayImageEffect, xrayView.Image, xrayView.History, xrayView.CurrentSource.Data); m_HistogramDisplay.AddHistogram(histogram); } LayoutInfo layoutInfo = new LayoutInfo(); layoutInfo.Name = "Histogram"; layoutInfo.Panel = PanelAssignment.InfoPanel; layoutInfo.Display = m_HistogramDisplay; Displays.Add(layoutInfo); } if (m_XrayImage != null && m_XrayImage.Count > 0) { System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens; if (views[0].ImageIndex == 61 && views.Count > 1 && screens.Length > 1) { UserControl1 panel0 = new UserControl1(m_XrayImage[0]); LayoutInfo layoutInfo0 = new LayoutInfo(); layoutInfo0.Name = "XRayPlugin-View0"; layoutInfo0.Panel = PanelAssignment.MainPanel; layoutInfo0.BringToFront = true; layoutInfo0.Display = panel0; layoutInfo0.StatusItems = m_statusBarItems.StatusDisplay; Displays.Add(layoutInfo0); UserControl1 panel1 = new UserControl1(m_XrayImage[1]); panel1.Margin = new Thickness(20); LayoutInfo layoutInfo1 = new LayoutInfo(); layoutInfo1.Name = "XRayPlugin-View1"; layoutInfo1.Panel = PanelAssignment.SecondaryPanel; layoutInfo1.BringToFront = true; layoutInfo1.Display = panel1; Displays.Add(layoutInfo1); } else { UserControl1 panel = new UserControl1(m_XrayImage); LayoutInfo layoutInfo = new LayoutInfo(); layoutInfo.Name = "XRayPlugin"; layoutInfo.Panel = PanelAssignment.MainPanel; layoutInfo.BringToFront = true; layoutInfo.Display = panel; layoutInfo.StatusItems = m_statusBarItems.StatusDisplay; Displays.Add(layoutInfo); } if (m_DisplayFTIError) { DisplayTIPError(); } } }
private void CreateXRayDisplays () { List<ViewObject> views = GetImageData(); if (views.Count > 0) { L3.Cargo.Workstation.Plugins.EAFB.XRayImages xrayview = new L3.Cargo.Workstation.Plugins.EAFB.XRayImages(); m_XrayImage = xrayview.CreateImages(views, m_statusBarItems, m_CaseObj.CaseHistories, m_SysConfig); m_XrayImage[0].FragmentMark_MenuItem.Click += new RoutedEventHandler(FragmentMark_MenuItem_Click); m_XrayImage[1].FragmentMark_MenuItem.Click += new RoutedEventHandler(FragmentMark_MenuItem_Click); m_XrayImage[0].FragmentRegisterView_Ellipse.Click += new RoutedEventHandler(FragmentRegisterView_MenuItem_Click); m_XrayImage[1].FragmentRegisterView_Ellipse.Click += new RoutedEventHandler(FragmentRegisterView_MenuItem_Click); m_XrayImage[0].FragmentUniformity_MenuItem.Click += new RoutedEventHandler(FragmentUniformity_MenuItem_Click); m_XrayImage[1].FragmentUniformity_MenuItem.Click += new RoutedEventHandler(FragmentUniformity_MenuItem_Click); m_XrayImage[0].CreateFramgmentMark_Ellipse.Click += new RoutedEventHandler(CreateFramgmentMark_MenuItem_Click); m_XrayImage[1].CreateFramgmentMark_Ellipse.Click += new RoutedEventHandler(CreateFramgmentMark_MenuItem_Click); m_XrayImage[0].PanZoom_MenuItem.Click += new RoutedEventHandler(PanZoom_MenuItem_Click); m_XrayImage[1].PanZoom_MenuItem.Click += new RoutedEventHandler(PanZoom_MenuItem_Click); m_XrayImage[0].MainXRayView.adonerImageObject.fragmentAdorner.Loaded += new RoutedEventHandler(fragmentAdornerView0_Loaded); //Conversion.SamplingSpace = m_SamplingSpace; m_View0FragmentAdorner = m_XrayImage[0].MainXRayView.adonerImageObject.fragmentAdorner; m_View1FragmentAdorner = m_XrayImage[1].MainXRayView.adonerImageObject.fragmentAdorner; m_View0FragmentAdorner.XrayViewNum = 0; m_View0FragmentAdorner.DefaultMarkRadiusSizePixels = m_defaultMarkRadiusSizeMillimeters / Conversion.SamplingSpace; if (views.Count > 1) { m_View1FragmentAdorner.Loaded += new RoutedEventHandler(fragmentAdornerView1_Loaded); m_View1FragmentAdorner.XrayViewNum = 1; m_View1FragmentAdorner.DefaultMarkRadiusSizePixels = m_defaultMarkRadiusSizeMillimeters / Conversion.SamplingSpace; } foreach (XRayImage image in m_XrayImage) { image.SetCreateNewAnnotation(m_CaseObj.IsCaseEditable); XRayView xrayView = image.MainView; Histogram histogram = new Histogram(); histogram.Setup(xrayView.XrayImageEffect, xrayView.Image, xrayView.History, xrayView.CurrentSource.Data); m_HistogramDisplay.AddHistogram(histogram); } LayoutInfo layoutInfo = new LayoutInfo(); layoutInfo.Name = "Histogram"; layoutInfo.Panel = PanelAssignment.InfoPanel; layoutInfo.Display = m_HistogramDisplay; Displays.Add(layoutInfo); } if (m_XrayImage != null && m_XrayImage.Count > 0) { System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens; if (views[0].ImageIndex == 61 && views.Count > 1 && screens.Length > 1) { UserControl1 panel0 = new UserControl1(m_XrayImage[0]); LayoutInfo layoutInfo0 = new LayoutInfo(); layoutInfo0.Name = "XRayPlugin-View0"; layoutInfo0.Panel = PanelAssignment.MainPanel; layoutInfo0.BringToFront = true; layoutInfo0.Display = panel0; layoutInfo0.StatusItems = m_statusBarItems.StatusDisplay; Displays.Add(layoutInfo0); UserControl1 panel1 = new UserControl1(m_XrayImage[1]); panel1.Margin = new Thickness(20); LayoutInfo layoutInfo1 = new LayoutInfo(); layoutInfo1.Name = "XRayPlugin-View1"; layoutInfo1.Panel = PanelAssignment.SecondaryPanel; layoutInfo1.BringToFront = true; layoutInfo1.Display = panel1; Displays.Add(layoutInfo1); } else { UserControl1 panel = new UserControl1(m_XrayImage); LayoutInfo layoutInfo = new LayoutInfo(); layoutInfo.Name = "XRayPlugin"; layoutInfo.Panel = PanelAssignment.MainPanel; layoutInfo.BringToFront = true; layoutInfo.Display = panel; layoutInfo.StatusItems = m_statusBarItems.StatusDisplay; Displays.Add(layoutInfo); } } }