Exemplo n.º 1
0
        public XRayImage (ViewObject viewObject, StatusBarItems statusBarItems, History history, SysConfiguration SysConfig)
        {
            InitializeComponent();
            MainXRayView.Image.Visibility = System.Windows.Visibility.Hidden;

            m_MagnifierSettings.IsMagniferEnabled = false;
            m_MagnifierSettings.Radius = 0;
            m_MagnifierSettings.MagnFactor = 2.0;
            m_MagnifierSettings.AspectRatio = 0;
            m_MaxDetectorsPerBoard = viewObject.MaxDetectorsPerBoard;
            m_bitsPerPixel = viewObject.BitsPerPixel;
            m_ViewObject = viewObject;
            m_statusBarItems = statusBarItems;

            MainXRayView.Setup(viewObject, history, SysConfig);   
            

            MainXRayView.adonerImageObject.measureAdorner.SamplingSpace = viewObject.SamplingSpace;
            MainXRayView.adonerImageObject.measureAdorner.SamplingSpeed = viewObject.SamplingSpeed;

            MainXRayView.Cursor = Cursors.Hand;
            MainXRayView.Image.MouseMove += new MouseEventHandler(Img_MouseMove);
            MainXRayView.Image.MouseLeave += new MouseEventHandler(Img_MouseLeave);

            MainXRayView.MagnifierDockPanel.SizeChanged += new SizeChangedEventHandler(Magnifier_SizeChanged);
            MainXRayView.MagnifierDockPanel.MouseMove += new MouseEventHandler(Magnifier_MouseMove);
            MainXRayView.MagnifierDockPanel.MouseLeftButtonDown += new MouseButtonEventHandler(Magnifier_MouseMove);
            
        }
Exemplo n.º 2
0
        public SysConfiguration GetDefaultConfig()
        {
            SysConfiguration sysConfig = m_SysConfigCollection["DefaultConfig"];

            sysConfig.Profile = m_ProfileManager.Profile;

            return(sysConfig);
        }
Exemplo n.º 3
0
 public FilterParameter (DockPanel panel, int width, int height, History history, SysConfiguration config)
 {
     dockPanel = panel;
     Width = width;
     Height = height;
     History = history;
     SysConfig = config;
 }
Exemplo n.º 4
0
        public ConfigManager (ProfileManager profileMgr, SysConfiguration sysConfig)
        {
            m_ProfileManager = profileMgr;

            m_SysConfigCollection = new Dictionary<string, SysConfiguration>();
            //TODO: Remove the configuration setting here
            sysConfig.m_SysConfigID = "DefaultConfig";
            m_SysConfigCollection.Add("DefaultConfig", sysConfig);
        }
Exemplo n.º 5
0
        public ConfigManager(ProfileManager profileMgr, SysConfiguration sysConfig)
        {
            m_ProfileManager = profileMgr;

            m_SysConfigCollection = new Dictionary <string, SysConfiguration>();
            //TODO: Remove the configuration setting here
            sysConfig.m_SysConfigID = "DefaultConfig";
            m_SysConfigCollection.Add("DefaultConfig", sysConfig);
        }
Exemplo n.º 6
0
        private AuthenticationLevel LoginToIndividualSource (string sourceAlias, string username, string password)
        {
            AuthenticationLevel ret = AuthenticationLevel.None;

            try
            {
                string wsId = m_SysConfig.GetDefaultConfig().WorkstationAlias;
                UserInfo userInfo = new UserInfo(username, password);
                WorkstationInfo wsInfo = new WorkstationInfo(wsId, userInfo);

                LoginResponse loginResponse = m_DataSourceAccess.Login(sourceAlias, wsInfo);

                ret = loginResponse.UserAuthenticationLevel;

                if (!ret.Equals(AuthenticationLevel.None))
                {
                    SysConfiguration sysConfig = new SysConfiguration();
                    sysConfig.ID = sourceAlias;
                    sysConfig.ContainerDBConnectionString = loginResponse.systemConfiguration.ContainerDBConnectString;
                    sysConfig.ContainerRefreshPeriodmsecs = loginResponse.systemConfiguration.ContainerRefreshPeriodSeconds * 1000;

                    if (m_SysConfig.Contains(sourceAlias))
                    {
                        m_SysConfig.Delete(sourceAlias);
                    }

                    m_SysConfig.Add(sysConfig);

                    if (m_SysConfig.UserProfileManager.Profile == null)
                    {
                        ProfileObject profile = ProfileTranslator.Translate(loginResponse.UserProfile, 4);
                        profile.SourceAlias = sourceAlias;
                        profile.UserName = wsInfo.userInfo.UserName;
                        profile.Password = wsInfo.userInfo.Password;

                        m_SysConfig.UserProfileManager.Profile = profile;
                        m_SysConfig.UserProfileManager.Profile.ProfileUpdatedEvent += new ProfileUpdated(ProfileUpdated);
                    }

                    DataSet caselist = null;
                    m_DataSourceAccess.GetCaseList(sourceAlias, out caselist);

                    if (caselist != null)
                    {
                        CaseListDataSet caseListDataSet = (CaseListDataSet)caselist;
                        caseListDataSet.CaseListTable.CaseListTableRowChanged +=
                            new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_CaseListTableRowChanged);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return ret;
        }
Exemplo n.º 7
0
        public UserControl1(CaseObject caseObj, SysConfiguration sysConfig)
        {
            InitializeComponent();
            CultureResources.registerDataProvider(this);

            m_CaseObj = caseObj;
            m_sysConfig = sysConfig;
            InfoDisplayArea.DataContext = m_CaseObj;
            m_LoadedOnce = false;
        }
Exemplo n.º 8
0
 public void Add(SysConfiguration sysConfig)
 {
     try
     {
         m_SysConfig.Add(sysConfig);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Exemplo n.º 9
0
 public void Add (SysConfiguration sysConfig)
 {
     try
     {
         m_SysConfig.Add(sysConfig);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Exemplo n.º 10
0
 public void Add (SysConfiguration sysConfig)
 {
     try
     {
         m_SysConfigCollection.Add(sysConfig.ID, sysConfig);
     }
     catch (Exception ex)
     {
         //TODO Log exception here
         throw ex;
     }
 }
Exemplo n.º 11
0
 public void Add(SysConfiguration sysConfig)
 {
     try
     {
         m_SysConfigCollection.Add(sysConfig.ID, sysConfig);
     }
     catch (Exception ex)
     {
         //TODO Log exception here
         throw ex;
     }
 }
Exemplo n.º 12
0
 public void Update(SysConfiguration sysConfig)
 {
     try
     {
         m_SysConfigCollection[sysConfig.ID] = sysConfig;
     }
     catch (Exception ex)
     {
         //TODO Log exception here
         throw ex;
     }
 }
Exemplo n.º 13
0
        public SysConfigManager()
        {
            //create profile manager with default user profile
            ProfileManager profileManager = new ProfileManager();

            SysConfiguration systemConfiguration = new SysConfiguration();

            //create configuration manager with profile manager and default system configuration.
            ConfigManager m_ConfigMgr = new ConfigManager(profileManager, systemConfiguration);

            //create system configuraiton manager interface
            m_SysConfigMgrAccess = new SysConfigMgrAccess(m_ConfigMgr);
        }
Exemplo n.º 14
0
        public SysConfigManager()
        {
            //create profile manager with default user profile
            ProfileManager profileManager = new ProfileManager();

            SysConfiguration systemConfiguration = new SysConfiguration();

            //create configuration manager with profile manager and default system configuration.
            ConfigManager m_ConfigMgr = new ConfigManager(profileManager, systemConfiguration);

            //create system configuraiton manager interface
            m_SysConfigMgrAccess = new SysConfigMgrAccess(m_ConfigMgr);
        }
Exemplo n.º 15
0
        public XRayDisplays (CaseObject caseObj, SysConfiguration SysConfig)
        {
            m_CaseObj = caseObj;
            m_SysConfig = SysConfig;
            m_statusBarItems = new StatusBarItems();
            m_HistogramDisplay = new HistogramDisplay();
            Displays = new List<LayoutInfo>();
            m_DisplayFTIError = false;
            
            instanceID = ++AlgClientInstances.InstanceNumber;
            _PxeAccess = new PxeAccess(instanceID);

            caseObj.DisplayTIPEvent += new CaseObject.DisplayTIPHandler(caseObj_DisplayTIPEvent);
            Initialize();
        }
Exemplo n.º 16
0
        public SysConfiguration GetConfig(string configId)
        {
            SysConfiguration sysConfig = null;

            if (m_SysConfigCollection.ContainsKey(configId))
            {
                sysConfig = m_SysConfigCollection[configId];
            }
            else
            {
                sysConfig = GetDefaultConfig();
            }

            sysConfig.Profile = m_ProfileManager.Profile;

            return(sysConfig);
        }
Exemplo n.º 17
0
        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;
            }
        }
Exemplo n.º 18
0
        public XRayDisplays (CaseObject caseObj, SysConfiguration SysConfig)
        {
            m_CaseObj = caseObj;
            m_SysConfig = SysConfig;
            m_statusBarItems = new StatusBarItems();
            m_HistogramDisplay = new HistogramDisplay();
            Displays = new List<LayoutInfo>();
            FragmentMarkInfoList = new Collection<FragmentObject>();

            m_FragmentDataDisplay = new FragmentDataDisplay(this);            

            foreach (DataAttachment attachment in caseObj.attachments.GetUnknownAttachments())
            {                
                if (attachment.attachmentId == "FragmentDataTable.csv")
                {
                    byte[] fragmentData = new byte[attachment.attachmentData.Length];
                    attachment.attachmentData.Read(fragmentData, 0, fragmentData.Length);
                    
                    FragmentMarkInfoList = m_FragmentDataDisplay.UpdateDisplay(fragmentData);
                }
            }

            StatusBarItem caseIDStatus = new StatusBarItem();
            caseIDStatus.Content = "Case ID :" + m_CaseObj.CaseId;
            m_statusBarItems.StatusDisplay.Add(caseIDStatus);

            Initialize();
        }
Exemplo n.º 19
0
 public void Update (SysConfiguration sysConfig)
 {
     m_SysConfig.Update(sysConfig);
 }
Exemplo n.º 20
0
 public void Update(SysConfiguration sysConfig)
 {
     m_SysConfig.Update(sysConfig);
 }
Exemplo n.º 21
0
        public List<XRayImage> CreateImages (List<ViewObject> viewObjs, StatusBarItems statusBarItems, Histories histories, SysConfiguration SysConfig)
        {
            List<XRayImage> xrayImages = new List<XRayImage>();

            string username = string.Empty;
            if (SysConfig.Profile != null)
            {
                username = SysConfig.Profile.UserName;
            }


            foreach (ViewObject viewObj in viewObjs)
            {
                int count = 0;
                try
                {
                    if (viewObj.HighEnergy != null || viewObj.LowEnergy != null)
                    {
                        History history = histories.Find(viewObj.Name);

                        if (history == null)
                        {
                            history = new History();
                            history.id = viewObj.Name;
                            histories.History.Add(history);
                        }

                        if (SysConfig.Profile != null)
                        {
                            history.DefaultUser = SysConfig.Profile.UserName;
                        }

                        count++;
                        XRayImage xrayImage = new XRayImage(viewObj, statusBarItems, history, SysConfig);

                        xrayImages.Add(xrayImage);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            foreach (XRayImage xrayImage in xrayImages)
            {
                foreach (XRayImage otherxrayImage in xrayImages)
                {
                    if (otherxrayImage != xrayImage)
                    {
                        xrayImage.PanZoom_MenuItem.Click += new RoutedEventHandler(otherxrayImage.PanZoom_MenuItem_Click);
                        xrayImage.FragmentMark_MenuItem.Click += new RoutedEventHandler(otherxrayImage.FragmentMark_MenuItem_Click);

                        xrayImage.FragmentRegisterView_Ellipse.Click += new RoutedEventHandler(otherxrayImage.FragmentRegisterView_Ellipse_MenuItem_Click);
                        xrayImage.FragmentUniformity_MenuItem.Click += new RoutedEventHandler(otherxrayImage.FragmentUniformity_MenuItem_Click);
                        xrayImage.CreateFramgmentMark_Ellipse.Click += new RoutedEventHandler(otherxrayImage.CreateFramgmentMark_Ellipse_MenuItem_Click);

                        xrayImage.FragmentMarks_Hide.Click += new RoutedEventHandler(otherxrayImage.FragmentAddMarks_Hide_MenuItem_Click);
                        xrayImage.FragmentMarks_Show.Click += new RoutedEventHandler(otherxrayImage.FragmentAddMarks_Show_MenuItem_Click);                                                                      
                    }
                }
            }

            return xrayImages;
        }
Exemplo n.º 22
0
        public XRayImage (ViewObject viewObject, StatusBarItems statusBarItems, History history, SysConfiguration SysConfig)
        {
            InitializeComponent();
            CultureResources.registerDataProvider(this);

            m_MagnifierSettings.IsMagniferEnabled = false;
            m_MagnifierSettings.Radius = 0;
            m_MagnifierSettings.MagnFactor = 2.0;
            m_MagnifierSettings.AspectRatio = 0;
            m_MaxDetectorsPerBoard = viewObject.MaxDetectorsPerBoard;
            m_bitsPerPixel = viewObject.BitsPerPixel;
            m_ViewObject = viewObject;
            m_statusBarItems = statusBarItems;

            XRayView_ContextMenu.Opened += new RoutedEventHandler(XRayView_ContextMenu_Changed);
            XRayView_ContextMenu.Closed += new RoutedEventHandler(XRayView_ContextMenu_Changed);

            MainXRayView.Setup(viewObject, history, SysConfig);

            MainXRayView.Cursor = Cursors.Hand;
            MainXRayView.MainImage.MouseMove += new MouseEventHandler(Img_MouseMove);
            MainXRayView.MainImage.MouseLeave += new MouseEventHandler(Img_MouseLeave);

            MainXRayView.Magnifier_Panel.SizeChanged += new SizeChangedEventHandler(Magnifier_SizeChanged);
            MainXRayView.Magnifier_Panel.MouseMove += new MouseEventHandler(Magnifier_MouseMove);
            MainXRayView.Magnifier_Panel.MouseLeftButtonDown += new MouseButtonEventHandler(Magnifier_MouseMove);

            if (viewObject.TIPMarkings != null)
            {
                HideFTILocations();

                //foreach (Rect rect in viewObject.TIPMarkings)
                //{
                //    MainXRayView.adonerImageObject.TIPAdorner.Add(rect);
                //}
            }

            MainXRayView.AlgServerRequestEvent += new AlgServerRequestEventHandler(MainXRayView_AlgServerRequestEvent);
        }
Exemplo n.º 23
0
        public List<XRayImage> CreateImages (List<ViewObject> viewObjs, StatusBarItems statusBarItems, Histories histories, SysConfiguration SysConfig)
        {
            List<XRayImage> xrayImages = new List<XRayImage>();

            string username = string.Empty;
            if (SysConfig.Profile != null)
            {
                username = SysConfig.Profile.UserName;
            }


            foreach (ViewObject viewObj in viewObjs)
            {
                int count = 0;
                try
                {
                    if (viewObj.HighEnergy != null || viewObj.LowEnergy != null)
                    {
                        History history = histories.Find(viewObj.Name);

                        if (history == null)
                        {
                            history = new History();
                            history.id = viewObj.Name;
                            histories.History.Add(history);
                        }

                        if (SysConfig.Profile != null)
                        {
                            history.DefaultUser = SysConfig.Profile.UserName;
                        }

                        count++;
                        XRayImage xrayImage = new XRayImage(viewObj, statusBarItems, history, SysConfig);
                        xrayImage.AlgServerRequestEvent += new AlgServerRequestEventHandler(xrayImage_AlgServerRequestEvent);

                        xrayImages.Add(xrayImage);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            foreach (XRayImage xrayImage in xrayImages)
            {
                foreach (XRayImage otherxrayImage in xrayImages)
                {
                    if (otherxrayImage != xrayImage)
                    {
                        xrayImage.PanZoom_MenuItem.Click += new RoutedEventHandler(otherxrayImage.PanZoom_MenuItem_Click);
                        xrayImage.Annotation_MenuItem.Click += new RoutedEventHandler(otherxrayImage.Annotation_MenuItem_Click);
                        xrayImage.Measurements_MenuItem.Click += new RoutedEventHandler(otherxrayImage.Measurements_MenuItem_Click);
                        xrayImage.Magnifier_MenuItem.Click += new RoutedEventHandler(otherxrayImage.Magnifier_MenuItem_Click);
                        xrayImage.AOI_MenuItem.Click += new RoutedEventHandler(otherxrayImage.AOI_MenuItem_Click);
                        xrayImage.Annotation_Rectangle.Click += new RoutedEventHandler(otherxrayImage.Annotation_Rectangle_MenuItem_Click);
                        xrayImage.Annotation_Ellipse.Click += new RoutedEventHandler(otherxrayImage.Annotation_Ellipse_MenuItem_Click);
                        xrayImage.Annotation_Show.Click += new RoutedEventHandler(otherxrayImage.Annotation_Show_MenuItem_Click);
                        xrayImage.Annotation_Hide.Click += new RoutedEventHandler(otherxrayImage.Annotation_Hide_MenuItem_Click);
                        xrayImage.Measurement_Show.Click += new RoutedEventHandler(otherxrayImage.Measurement_Show_MenuItem_Click);
                        xrayImage.Measurement_Hide.Click += new RoutedEventHandler(otherxrayImage.Measurement_Hide_MenuItem_Click);
                    }
                }
            }

            return xrayImages;
        }
Exemplo n.º 24
0
 public void Update (SysConfiguration sysConfig)
 {
     try
     {
         m_SysConfigCollection[sysConfig.ID] = sysConfig;
     }
     catch (Exception ex)
     {
         //TODO Log exception here
         throw ex;
     }
 }
Exemplo n.º 25
0
 public ContentParameter (CaseObject caseObj, SysConfiguration sysConfig)
 {
     caseObject = caseObj;
     SysConfig = sysConfig;
 }