예제 #1
0
        private void TargetPanel_Drop(object sender, DragEventArgs e)
        {
            var             dataObj     = e.Data as DataObject;
            ImageEntity     dragged     = dataObj.GetData(typeof(ImageEntity)) as ImageEntity;
            CameraContainer selectedCam = cams.Where(c => c.Name == dragged.CameraName).SingleOrDefault();

            selectedCam.bActive = true;
            LayoutPanel droppedOn = e.Source as LayoutPanel;

            panels.Clear();
            FindPanels(((LayoutGroup)Groups) as DependencyObject);
            for (int y = 0; y < panels.Count; y++)
            {
                if (panels[y].Caption == droppedOn.Caption)
                {
                    addViews(panels[y], selectedCam);

                    //panels[y + 1].Visibility = Visibility.Visible;
                    //panels[y + 1].Content = selectedCam.hist;
                    //panels[y + 1].Name = "hist" + selectedCam.Name;
                }
            }
            //           droppedOn.Content = selectedCam.preview;
            SetTrayImageToinUse(dragged);
        }
예제 #2
0
        private void addViews(LayoutPanel pan1, CameraContainer activecam)
        {
            DockLayoutManager doc = new DockLayoutManager();

            pan1.Content = doc;
            LayoutGroup gr2 = new LayoutGroup()
            {
                Orientation = Orientation.Horizontal
            };

            doc.LayoutRoot = gr2;
            LayoutPanel settings = new LayoutPanel();

            settings.Content = activecam.settings;
            gr2.Add(settings);
            LayoutPanel prev = new LayoutPanel();

            prev.Content = activecam.preview;
            gr2.Add(prev);
            LayoutPanel hist = new LayoutPanel();

            hist.Content = activecam.hist;
            gr2.Add(hist);
            pan1.Caption = activecam.Name;   //panel contains preview
        }
예제 #3
0
        void SetTrayImageToinUse(ImageEntity item)
        {
            CameraContainer selected = cams.Where(c => c.Name == item.CameraName).SingleOrDefault();

            selected.bActive = true;
            //show the tray image as camera in preview mode
            selected.trayImage.ImagePath = File.ReadAllBytes("preview.png");
        }
예제 #4
0
 private bool SetupAttachedCams(ObservableCollection <ImageEntity> ListImageObj)
 {
     for (int i = 0; i < nAttachedCams; i++)
     {
         CameraContainer cam = new CameraContainer(i, ListImageObj[i], LsImageGallery);
         cams.Add(cam);
     }
     return(true);
 }
예제 #5
0
        // find the first free panel and assign to the camera
        private void Addframe(CameraContainer cam, List <LayoutPanel> panels)
        {
            List <LayoutPanel> freepanels = panels.Where(p => p.Content == null).ToList();

            if (freepanels.Count == 0)
            {
                return;
            }
            //Preview cam = new Preview();
            //camlist.Add(cam);
            cam.bActive           = true;
            freepanels[0].Content = cam.preview;
            freepanels[0].Caption = cam.Name;
            freepanels[1].Content = cam.hist;
            freepanels[1].Name    = "hist" + cam.Name;
        }
예제 #6
0
        //reset the previewed camera to not active and close the associated histogram window
        void SetTrayImageToNotinPreview(LayoutPanel item)
        {
            CameraContainer selected = cams.Where(c => c.Name == item.Caption).SingleOrDefault();

            if (selected == null)
            {
                return;
            }
            selected.bActive = false;
            panels.Clear();
            FindPanels(((LayoutGroup)Groups) as DependencyObject);
            //close the associated Histogram as we close the preview
            string associatedHist = "hist" + selected.Name;

            for (int y = 0; y < panels.Count; y++)
            {
                if (panels[y].Name == associatedHist)
                {
                    docMan.DockController.RemovePanel(panels[y]);
                }
            }
        }