Example #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);
        }
 protected override void UnloadCore()
 {
     contentGroup = null;
     RibbonEntries.Clear();
     StatusBarItems.Clear();
     GisEditor.DockWindowManager.DocumentWindows.CollectionChanged -= DocumentWindows_CollectionChanged;
 }
Example #3
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();
        }
Example #4
0
 protected PaneWithZoomViewModel(IMessenger messenger, IUIServices uiServices)
     : base(messenger, uiServices)
 {
     StatusBarItems.Add(new StatusBarItem(new StatusBarItemContext {
         Value = this, IsVisible = true
     }, StatusBarItemType.Zoom, "Zoom", System.Windows.Controls.Dock.Right));
 }
        public QueryEditorViewModel(IMessenger messenger, IDocumentDbService dbService, IDialogService dialogService, IUIServices uiServices)
            : base(messenger, uiServices)
        {
            EditorViewModel            = SimpleIoc.Default.GetInstanceWithoutCaching <JsonViewerViewModel>();
            EditorViewModel.IsReadOnly = true;

            HeaderViewModel            = SimpleIoc.Default.GetInstanceWithoutCaching <HeaderEditorViewModel>();
            HeaderViewModel.IsReadOnly = true;

            _dbService     = dbService;
            _dialogService = dialogService;

            _requestChargeStatusBarItem = new StatusBarItem(new StatusBarItemContext {
                Value = RequestCharge, IsVisible = IsRunning
            }, StatusBarItemType.SimpleText, "Request Charge", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_requestChargeStatusBarItem);
            _queryInformationStatusBarItem = new StatusBarItem(new StatusBarItemContext {
                Value = QueryInformation, IsVisible = IsRunning
            }, StatusBarItemType.SimpleText, "Information", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_queryInformationStatusBarItem);
            _progessBarStatusBarItem = new StatusBarItem(new StatusBarItemContextCancellableCommand {
                Value = CancelCommand, IsVisible = IsRunning, IsCancellable = true
            }, StatusBarItemType.ProgessBar, "Progress", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_progessBarStatusBarItem);
        }
Example #6
0
 protected PaneViewModelBase(IMessenger messenger, IUIServices uiServices)
     : base(messenger, uiServices)
 {
     _pathStatusBarItem = new StatusBarItem(new StatusBarItemContext {
         Value = ToolTip, IsVisible = true
     }, StatusBarItemType.SimpleText, "Path", System.Windows.Controls.Dock.Left);
     StatusBarItems.Add(_pathStatusBarItem);
     _uiServices = uiServices;
 }
Example #7
0
        public ImportDocumentViewModel(IMessenger messenger, IDialogService dialogService, IDocumentDbService dbService, IUIServices uiServices)
            : base(messenger, uiServices)
        {
            Content        = new TextDocument();
            _dialogService = dialogService;
            _dbService     = dbService;

            _progessBarStatusBarItem = new StatusBarItem(new StatusBarItemContextCancellableCommand {
                Value = CancelCommand, IsVisible = IsRunning, IsCancellable = false
            }, StatusBarItemType.ProgessBar, "Progress", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_progessBarStatusBarItem);
        }
Example #8
0
        public void Dispose()
        {
            m_HistogramDisplay.Dispose();

            if (Displays != null)
            {
                foreach (LayoutInfo layoutInfo in Displays)
                {
                    UserControl1 userControl1 = layoutInfo.Display as UserControl1;

                    if (userControl1 != null)
                    {
                        userControl1.Dispose();
                    }
                    else
                    {
                        HistogramDisplay histogramDisplay = layoutInfo.Display as HistogramDisplay;

                        if (histogramDisplay != null)
                        {
                            histogramDisplay.Dispose();
                        }
                    }
                }

                Displays.Clear();
            }

            byte[] filedata = null;
            try
            {
                string tfn = Path.GetTempFileName();
                m_FragmentDataDisplay.SaveReport(tfn);
                if (File.Exists(tfn))
                {
                    string data = File.ReadAllText(tfn);
                    System.Text.ASCIIEncoding en = new System.Text.ASCIIEncoding();
                    filedata = en.GetBytes(data);
                    DataAttachment attachment = new DataAttachment();
                    attachment.attachmentId   = "FragmentDataTable.csv";
                    attachment.attachmentType = AttachmentType.Unknown;
                    attachment.attachmentData = new MemoryStream(filedata, true); //MemoryStream
                    //   MemoryStream ms = new MemoryStream();
                    m_CaseObj.NewAttachments.Add(attachment);
                    File.Delete(tfn); //not working
                }
            }
            catch { }
            m_statusBarItems.StatusDisplay.Clear();
            m_statusBarItems = null;
            m_CaseObj        = null;
        }
Example #9
0
        protected override void UnloadCore()
        {
            base.UnloadCore();

            if (StatusBarItems.Contains(displayTextBlock))
            {
                StatusBarItems.Remove(displayTextBlock);
            }
            if (StatusBarItems.Contains(selectedTextBlock))
            {
                StatusBarItems.Remove(selectedTextBlock);
            }
        }
Example #10
0
        public void Dispose()
        {
            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);

            m_statusBarItems = null;

            MainXRayView.Dispose();
            MainXRayView = null;
        }
Example #11
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();
        }
        protected override void LoadCore()
        {
            base.LoadCore();
            option = Singleton <ContentSetting> .Instance;

            if (!RibbonEntries.Contains(contentEntry))
            {
                RibbonEntries.Add(contentEntry);
            }
            if (!StatusBarItems.Contains(StatusBar.GetInstance()))
            {
                StatusBarItems.Add(StatusBar.GetInstance());
            }
            GisEditor.DockWindowManager.DocumentWindows.CollectionChanged -= DocumentWindows_CollectionChanged;
            GisEditor.DockWindowManager.DocumentWindows.CollectionChanged += DocumentWindows_CollectionChanged;
        }
        public StoredProcedureTabViewModel(IMessenger messenger, IDialogService dialogService, IDocumentDbService dbService, IUIServices uiServices)
            : base(messenger, dialogService, dbService, uiServices)
        {
            _dialogService = dialogService;
            _dbService     = dbService;

            ResultViewModel            = SimpleIoc.Default.GetInstanceWithoutCaching <JsonViewerViewModel>();
            ResultViewModel.IsReadOnly = true;

            HeaderViewModel            = SimpleIoc.Default.GetInstanceWithoutCaching <HeaderEditorViewModel>();
            HeaderViewModel.IsReadOnly = true;

            _requestChargeStatusBarItem = new StatusBarItem(new StatusBarItemContext {
                Value = RequestCharge, IsVisible = IsBusy
            }, StatusBarItemType.SimpleText, "Request Charge", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_requestChargeStatusBarItem);
        }
Example #14
0
        public CollectionMetricsTabViewModel(IMessenger messenger, IUIServices uiServices,
                                             IDialogService dialogService,
                                             IDocumentDbService dbService)
            : base(messenger, uiServices)
        {
            _dbService     = dbService;
            _dialogService = dialogService;

            Title  = "Collection Metrics";
            Header = Title;

            _requestChargeStatusBarItem = new StatusBarItem(new StatusBarItemContext {
                Value = RequestCharge, IsVisible = IsBusy
            }, StatusBarItemType.SimpleText, "Request Charge", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_requestChargeStatusBarItem);

            ChartConfiguration();
        }
Example #15
0
        protected override void LoadCore()
        {
            base.LoadCore();

            if (!RibbonEntries.Contains(selectionAndQueryingEntry))
            {
                RibbonEntries.Add(selectionAndQueryingEntry);
            }
            if (!RibbonEntries.Contains(helpEntry))
            {
                RibbonEntries.Add(helpEntry);
            }
            if (!StatusBarItems.Contains(displayTextBlock))
            {
                StatusBarItems.Add(displayTextBlock);
            }
            if (!StatusBarItems.Contains(selectedTextBlock))
            {
                StatusBarItems.Add(selectedTextBlock);
            }
        }
        public DocumentsTabViewModel(IMessenger messenger, IDocumentDbService dbService, IDialogService dialogService, IUIServices uiServices)
            : base(messenger, uiServices)
        {
            Documents      = new ObservableCollection <DocumentDescription>();
            _dbService     = dbService;
            _dialogService = dialogService;

            EditorViewModel            = SimpleIoc.Default.GetInstanceWithoutCaching <DocumentEditorViewModel>();
            HeaderViewModel            = SimpleIoc.Default.GetInstanceWithoutCaching <HeaderEditorViewModel>();
            HeaderViewModel.IsReadOnly = true;

            Title  = "Documents";
            Header = Title;

            _requestChargeStatusBarItem = new StatusBarItem(new StatusBarItemContext {
                Value = RequestCharge
            }, StatusBarItemType.SimpleText, "Request Charge", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_requestChargeStatusBarItem);
            _progessBarStatusBarItem = new StatusBarItem(new StatusBarItemContextCancellableCommand {
                Value = IsRunning, IsVisible = IsRunning, IsCancellable = false
            }, StatusBarItemType.ProgessBar, "Progress", System.Windows.Controls.Dock.Left);
            StatusBarItems.Add(_progessBarStatusBarItem);
        }
Example #17
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);
        }
Example #18
0
        public void Dispose()
        {
            _PxeAccess.Dispose();

            AlgClientInstances.InstanceNumber--;

            m_HistogramDisplay.Dispose();

            if (m_Annotations == null)
            {
                m_Annotations = new Dictionary <string, List <AnnotationInfo> >();
            }
            else
            {
                m_Annotations.Clear();
            }

            if (m_XrayImage != null)
            {
                foreach (XRayImage image in m_XrayImage)
                {
                    if (!m_Annotations.ContainsKey(image.ViewName))
                    {
                        List <Annotation>     annots = image.GetAnnotations();
                        List <AnnotationInfo> infos  = new List <AnnotationInfo>();
                        foreach (Annotation ann in annots)
                        {
                            infos.Add(new AnnotationInfo(ann.Marking.Rect.TopLeft, ann.Marking.Rect.Width, ann.Marking.Rect.Height, ann.Marking.RadiusX, ann.Marking.RadiusY, ann.CommentText));
                        }
                        m_Annotations.Add(image.ViewName, infos);
                    }
                }
            }

            if (Displays != null)
            {
                foreach (LayoutInfo layoutInfo in Displays)
                {
                    UserControl1 userControl1 = layoutInfo.Display as UserControl1;

                    if (userControl1 != null)
                    {
                        userControl1.Dispose();
                    }
                    else
                    {
                        HistogramDisplay histogramDisplay = layoutInfo.Display as HistogramDisplay;

                        if (histogramDisplay != null)
                        {
                            histogramDisplay.Dispose();
                        }
                    }
                }

                Displays.Clear();
            }

            DataAttachment dataAttachment = null;

            foreach (DataAttachment attachment in m_CaseObj.attachments.GetAnnotationsAttachments())
            {
                dataAttachment = attachment;
                break;
            }

            if (dataAttachment == null)
            {
                dataAttachment = new DataAttachment();
                dataAttachment.attachmentId   = "Annotations.xml";
                dataAttachment.attachmentType = AttachmentType.Annotations;
                dataAttachment.CreateTime     = CultureResources.ConvertDateTimeToStringForData(DateTime.Now);
            }

            dataAttachment.attachmentData = (MemoryStream)AnnotationsTranslator.CreateXML(m_Annotations);
            dataAttachment.IsNew          = true;
            m_CaseObj.NewAttachments.Add(dataAttachment);

            m_statusBarItems.StatusDisplay.Clear();
            m_statusBarItems = null;
            m_CaseObj        = null;
        }
Example #19
0
        private void PopulatePanels()
        {
            foreach (ContentInstance content in ContentInstances)
            {
                try
                {
                    foreach (LayoutInfo layoutInfo in content.Instance.UserControlDisplays)
                    {
                        TabControl tabControl;

                        switch (layoutInfo.Panel)
                        {
                        case PanelAssignment.MainPanel:
                            tabControl = m_PanelLayout.MainTabControl;
                            break;

                        case PanelAssignment.SubPanel:
                            tabControl = m_PanelLayout.SubTabControl;
                            break;

                        case PanelAssignment.InfoPanel:
                            tabControl = m_PanelLayout.InfoTabControl;
                            break;

                        case PanelAssignment.SecondaryPanel:
                            tabControl = m_SecTabControl;
                            break;

                        default:
                            tabControl = m_PanelLayout.MainTabControl;
                            break;
                        }

                        TabItem   displayTabItem = new TabItem();
                        DockPanel tabPanel       = new DockPanel();

                        // Bind the header text to the resource
                        var binding = new Binding(layoutInfo.Name);
                        binding.Source = CultureResources.getDataProvider();
                        BindingOperations.SetBinding(displayTabItem, TabItem.HeaderProperty, binding);

                        displayTabItem.Content = tabPanel;

                        tabPanel.Children.Insert(0, layoutInfo.Display);

                        if (!tabControl.Items.Contains(displayTabItem))
                        {
                            if (layoutInfo.BringToFront)
                            {
                                tabControl.Items.Insert(0, displayTabItem);
                            }
                            else
                            {
                                tabControl.Items.Add(displayTabItem);
                            }
                        }

                        if (layoutInfo.StatusItems != null)
                        {
                            foreach (StatusBarItem statusItem in layoutInfo.StatusItems)
                            {
                                if (!StatusBarItems.Contains(statusItem))
                                {
                                    StatusBarItems.Add(statusItem);
                                }
                            }
                        }
                    }
                    if (content.Instance.PrinterObject != null)
                    {
                        m_PrinterObjects.Add(content.Instance.PrinterObject);
                    }
                }
                catch (Exception ex)
                {
                    //TODO: Log Message here.
                    //MessageBox.Show(ex.ToString());
                }
            }
        }