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.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(); } } }