public void Setup(ViewObject content, History history, SysConfiguration sysConfig) { if (!IsSetup) { m_ViewObject = content; m_History = history; m_History.CurrentHistoryChangedEvent += new CurrentHistoryChanged(ApplyHistory); if (m_ViewObject.HighEnergy != null) { m_SourceObject = m_ViewObject.HighEnergy; HEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/HEOn.png", UriKind.Relative)); LEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/LEOff.png", UriKind.Relative)); } else if (m_ViewObject.LowEnergy != null) { m_SourceObject = m_ViewObject.LowEnergy; HEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/HEOff.png", UriKind.Relative)); LEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/LEOn.png", UriKind.Relative)); } else { throw new Exception(); } if (m_ViewObject.LowEnergy == null || m_ViewObject.HighEnergy == null) { XRayDualEnergy_ToolBar.Visibility = Visibility.Collapsed; } else { HistoryDualEnergy dualEnergy = new HistoryDualEnergy(); dualEnergy.name = "HighEnergy"; m_History.SetFirstStep(dualEnergy); } if (sysConfig != null) { m_sysConfig = sysConfig; CreateUserMacroControls(); Macro_Toolbar.Visibility = Visibility.Visible; } CreateBufferControls(); CreateFilterControls(); CreateColorMappingControls(); MainImage.Source = m_SourceObject.Source; MainImage.Height = m_SourceObject.Height; MainImage.Width = m_SourceObject.Width; HistoryBuffer buffer = new HistoryBuffer(); buffer.name = "Original Gray Scale"; m_History.SetFirstStep(buffer); HistoryList.DataContext = m_History.Step; IsApplyHistoryFromSetup = true; m_History.ApplyStep(); IsApplyHistoryFromSetup = false; IsSetup = true; } }
public void Setup (ViewObject content, History history, SysConfiguration sysConfig) { if (!IsSetup) { m_ViewObject = content; m_History = history; m_History.CurrentHistoryChangedEvent += new CurrentHistoryChanged(ApplyHistory); if (m_ViewObject.HighEnergy != null) { m_SourceObject = m_ViewObject.HighEnergy; HEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/HEOn.png", UriKind.Relative)); LEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/LEOff.png", UriKind.Relative)); } else if (m_ViewObject.LowEnergy != null) { m_SourceObject = m_ViewObject.LowEnergy; HEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/HEOff.png", UriKind.Relative)); LEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/LEOn.png", UriKind.Relative)); } else { throw new Exception(); } if (m_ViewObject.LowEnergy == null || m_ViewObject.HighEnergy == null) { XRayDualEnergy_ToolBar.Visibility = Visibility.Collapsed; } else { HistoryDualEnergy dualEnergy = new HistoryDualEnergy(); dualEnergy.name = "HighEnergy"; m_History.SetFirstStep(dualEnergy); } if (sysConfig != null) { m_sysConfig = sysConfig; CreateUserMacroControls(); Macro_Toolbar.Visibility = Visibility.Visible; } CreateBufferControls(); CreateFilterControls(); CreateColorMappingControls(); MainImage.Source = m_SourceObject.Source; MainImage.Height = m_SourceObject.Height; MainImage.Width = m_SourceObject.Width; HistoryBuffer buffer = new HistoryBuffer(); buffer.name = "Original Gray Scale"; m_History.SetFirstStep(buffer); HistoryList.DataContext = m_History.Step; IsApplyHistoryFromSetup = true; m_History.ApplyStep(); IsApplyHistoryFromSetup = false; IsSetup = true; } }
private void ApplyDualEnergy(string name, bool logHistory) { if (!String.IsNullOrWhiteSpace(name)) { Clear_DualEnergySettings(); if (name == "HighEnergy") { if (m_ViewObject.HighEnergy != null) { MainImage.Source = m_ViewObject.HighEnergy.Source; XrayImage_Panel.Effect = _XrayImageEffect; HEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/HEOn.png", UriKind.Relative)); } } else if (name == "LowEnergy") { if (m_ViewObject.LowEnergy != null) { MainImage.Source = m_ViewObject.LowEnergy.Source; XrayImage_Panel.Effect = _XrayImageEffect; LEImage.Source = new BitmapImage(new Uri(@"/L3.Cargo.Workstation.Plugins.XRayImageBase;component/Resources/Icons/LEOn.png", UriKind.Relative)); } } else if (name == "Trimat") { if (AlgServerRequestEvent != null) { XrayImage_Panel.Effect = null; AlgServerRequestEvent(this, new AlgServerRequestEventArgs(AlgServerRequest.TrimatImage)); } } else if (name == "Quadmat") { if (AlgServerRequestEvent != null) { XrayImage_Panel.Effect = null; AlgServerRequestEvent(this, new AlgServerRequestEventArgs(AlgServerRequest.QuadmatImage)); } } else if (name == "OrganicStrip") { if (AlgServerRequestEvent != null) { XrayImage_Panel.Effect = null; AlgServerRequestEvent(this, new AlgServerRequestEventArgs(AlgServerRequest.OrganicStripImage)); } } else if (name == "InorganicStrip") { if (AlgServerRequestEvent != null) { XrayImage_Panel.Effect = null; AlgServerRequestEvent(this, new AlgServerRequestEventArgs(AlgServerRequest.InOrganicStripImage)); } } else if (name == "MetalStrip") { if (AlgServerRequestEvent != null) { XrayImage_Panel.Effect = null; AlgServerRequestEvent(this, new AlgServerRequestEventArgs(AlgServerRequest.MetalStripImage)); } } if (logHistory) { HistoryDualEnergy dualEnergy = new HistoryDualEnergy(); dualEnergy.name = name; History.AddStep(dualEnergy); } } }