示例#1
0
        void XRiteColorDis_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }
            ColorTrend pc = new ColorTrend();

            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (testHelper.CurrentChart == null)
            {
                SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                return;
            }
            List <WriteableBitmap> wbl = new List <WriteableBitmap>();
            List <Color>           sl  = new List <Color>();

            for (int i = 1; i < 4; i++)
            {
                for (int j = 1; j < 7; j++)
                {
                    if ((testHelper.CurrentChart as XRiteColorChart).mp.SelectedArea.ContainsKey("Area_" + i.ToString() + "_" + j.ToString()))
                    {
                        wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_" + i.ToString() + "_" + j.ToString()]);
                        sl.Add((testHelper.CurrentChart as XRiteColorChart).ColorList[(i - 1) * 6 + j - 1]);
                    }
                }
            }
            pc.setStandardColorList(sl);
            pc.Test(wbl);
        }
示例#2
0
        //void autoTest()
        //{
        //    if (!TestChartNull()) { return; }
        //    //try{
        //        BeginTime = DateTime.Now;
        //        Begin();
        //        EndTime = DateTime.Now;
        //    //}
        //    //catch (Exception e)
        //    //{
        //    //    SilverlightLFC.common.Environment.ShowMessage(e.Message);
        //    //}
        //}
        //public void Test()
        //{
        //    //mark = new MarkProcess(ProcPhoto);
        //    if (ChartPhoto.getChart() == null) { return; }
        //    processbar.Value = 0;
        //    //ResultPanel.Children.Clear();

        //    //Button li=;
        //    t.setChart(ChartPhoto.getChart());
        //    //t.PhotoTestProc += new PhotoTestProcessHandler(t_PhotoTestProc);
        //    t.CorrectISO12233Chart();
        //    t.BeginAnalyse();
        //    //t.sendProcEvent(true, "");
        //    //processbar.Value = 30;

        //    sw.Stop();
        //    sw.Start();

        //    long r = t.getLPResoveLines();
        //    //li = new Button();
        //    //li.Name = "ResolvingPower";
        //    buttonRayleiResolution.Content = "分辨率(中央):" + r.ToString() + " LW/PH";
        //    buttonRayleiResolution.SetValue(ToolTipService.ToolTipProperty, "利用瑞利判据,直观判断相机分辨率,数据表示在一张照片里面可以分辨的垂直线条的数量");
        //    //li.Click += new RoutedEventHandler(RayleiResolution_Click);
        //    //ResultPanel.Children.Add(li);
        //    //t.sendProcEvent(true, "");
        //    //processbar.Value = 50;

        //    r = t.getHEdgeResoveLines();
        //    //li = new Button();
        //    //li.Name = "HResolvingPower";
        //    buttonHMTF.Content = "分辨率(水平线):" + r.ToString() + " LW/PH";
        //    buttonHMTF.SetValue(ToolTipService.ToolTipProperty, "利用水平线条测试分辨率,接近相机的中心分辨率,数据表示在一张照片里面可以分辨的垂直线条的数量");
        //    //li.Click += new RoutedEventHandler(HMTF_Click);
        //    //ResultPanel.Children.Add(li);
        //    //t.sendProcEvent(true, "");
        //    //processbar.Value = 60;

        //    r = t.getVEdgeResoveLines();
        //    //li = new Button();
        //    //li.Name = "VResolvingPower";
        //    buttonVMTF.Content = "分辨率(垂直线):" + r.ToString() + " LW/PH";
        //    buttonVMTF.SetValue(ToolTipService.ToolTipProperty, "利用垂直线条测试分辨率,接近相机的边沿分辨率,数据表示在一张照片里面可以分辨的垂直线条的数量");
        //    //li.Click += new RoutedEventHandler(VMTF_Click);
        //    //ResultPanel.Children.Add(li);
        //    //t.sendProcEvent(true, "");
        //    //processbar.Value = 70;

        //    //li = new Button();
        //    decimal d = t.getHDispersiveness();
        //    //li.Name = "HDispersiveness";
        //    buttonHDispersiveness.Content = "色散(水平线):" + d.ToString() + " pxl";
        //    buttonHDispersiveness.SetValue(ToolTipService.ToolTipProperty, "利用水平线条测试,接近中央色散程度,数据表示红绿蓝三原色在边界分离的程度,无色散时为0");
        //    //li.Click += new RoutedEventHandler(VDispersiveness_Click);
        //    //ResultPanel.Children.Add(li);
        //    //t.sendProcEvent(true, "");
        //    //processbar.Value = 85;

        //    //li = new Button();
        //    d = t.getVDispersiveness();
        //    //li.Name = "VDispersiveness";
        //    buttonVDispersiveness.Content = "色散(垂直线):" + d.ToString() + " pxl";
        //    buttonVDispersiveness.SetValue(ToolTipService.ToolTipProperty, "利用垂直线条测试,接近边沿色散程度,数据表示红绿蓝三原色在边界分离的程度,无色散时为0");
        //    //li.Click += new RoutedEventHandler(HDispersiveness_Click);
        //    //ResultPanel.Children.Add(li);
        //    //t.sendProcEvent(true, "");
        //    //processbar.Value = 100;

        //    sw.Stop();
        //    ResultPanel.SetValue(ToolTipService.ToolTipProperty, "测试共花费" + sw.Interval.Milliseconds.ToString() + "ms");

        //    IsTested = true;
        //    TestProject.TestHtml.Add(WriteHTML());
        //}
        //double PrcoStep = 100 / 6d;
        //void t_PhotoTestProc(object sender, PhotoTestProcessEventArgs e)
        //{
        //    processbar.Value = processbar.Value + PrcoStep;
        //    if (processbar.Value >= 99.5)
        //    {
        //        t.PhotoTestProc -= new PhotoTestProcessHandler(t_PhotoTestProc);
        //    }
        //}
        void RayleiResolution_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }
            RayleiResolution pc = new RayleiResolution();

            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (ChartPhoto.IsSelect)
            {
                pc.Test(ChartPhoto.getSelectArea());
            }
            else
            {
                if (testHelper.CurrentChart == null)
                {
                    SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                    return;
                }
                if (testHelper.CurrentChart.ProcessInfor.ContainsKey("RayleiResolutionIsLeft"))
                {
                    if (Convert.ToBoolean(testHelper.CurrentChart.ProcessInfor["RayleiResolutionIsLeft"]))
                    {
                        pc.IsLeft = true;
                        pc.Test(testHelper.CurrentChart.mp.SelectedArea["RayleiResolutionLArea"]);
                    }
                    else
                    {
                        pc.IsLeft = false;
                        pc.Test(testHelper.CurrentChart.mp.SelectedArea["RayleiResolutionRArea"]);
                    }
                }
            }
        }
示例#3
0
        void XRiteNoise_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }

            Noise pc = new Noise();

            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (testHelper.CurrentChart == null)
            {
                SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                return;
            }
            List <WriteableBitmap> wbl = new List <WriteableBitmap>();

            if (testHelper.CurrentChart.mp.SelectedArea.ContainsKey("Area_4_1"))
            {
                wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_4_1"]);
                wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_4_2"]);
                wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_4_3"]);
                wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_4_4"]);
                wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_4_5"]);
                wbl.Add(testHelper.CurrentChart.mp.SelectedArea["Area_4_6"]);
            }
            pc.Test(wbl);
        }
示例#4
0
        void HDispersiveness_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }
            Dispersiveness pc = new Dispersiveness();

            pc.IsV = true;
            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (ChartPhoto.IsSelect)
            {
                pc.Test(ChartPhoto.getSelectArea());
            }
            else
            {
                if (testHelper.CurrentChart == null)
                {
                    SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                    return;
                }
                if (testHelper.CurrentChart.mp.SelectedArea.ContainsKey("AreaVEdge"))
                {
                    pc.Test(testHelper.CurrentChart.mp.SelectedArea["AreaVEdge"]);
                }
            }
        }
示例#5
0
        void XMarkAberration_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }
            Aberration pc = new Aberration();

            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (testHelper.CurrentChart == null)
            {
                SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                return;
            }
            if (ChartPhoto.IsSelect)
            {
                pc.Test(ChartPhoto.getSelectArea());
            }
            else
            {
                if (testHelper.CurrentChart.getCorrectPhoto() != null)
                {
                    pc.Test(testHelper.CurrentChart.getCorrectPhoto());
                }
            }
        }
示例#6
0
        void XMarkWhiteBalance_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }
            WhiteBanlance pc = new WhiteBanlance();

            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (testHelper.CurrentChart == null)
            {
                SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                return;
            }
            List <WriteableBitmap> wbl = new List <WriteableBitmap>();

            if (testHelper.CurrentChart.mp.SelectedArea.ContainsKey("AreaBW_1"))
            {
                for (int i = 1; i < 23; i++)
                {
                    wbl.Add(testHelper.CurrentChart.mp.SelectedArea["AreaBW_" + i.ToString()]);
                }
            }
            pc.Test(wbl);
        }
示例#7
0
        void XMarkBrightChanges_Click(object sender, RoutedEventArgs e)
        {
            if (!CameraTestDesktop.CanAccess(Version.Professional))
            {
                return;
            }
            BrightDistance pc = new BrightDistance();

            CameraTestDesktop.getDesktopPanel().Children.Add(pc);
            if (testHelper.CurrentChart == null)
            {
                SilverlightLFC.common.Environment.ShowMessage("没有选择测试照片做进一步测试");
                return;
            }

            List <WriteableBitmap> bl = new List <WriteableBitmap>();

            bl.Add((testHelper.CurrentChart as XMarkChart).CropPhoto);
            //t.getCurveBrightnessChange();
            if (testHelper.CurrentChart.mp.SelectedArea.ContainsKey("AreaHBright"))
            {
                bl.Add(testHelper.CurrentChart.mp.SelectedArea["AreaHBright"]);
                bl.Add(testHelper.CurrentChart.mp.SelectedArea["AreaVBright"]);
            }
            pc.Test(bl);
        }
示例#8
0
        public void HideWindow(FrameworkElement fe)//关闭单独的窗体
        {
            Panel p = CameraTestDesktop.getDesktopPanel();

            if (p.Children.Contains(fe))
            {
                p.Children.Remove(fe);
            }
        }
示例#9
0
        List <PhotoEditCanvas> EditPhotoList = new List <PhotoEditCanvas>(); //所有的正在编辑的对象

        public void ShowWindow(FrameworkElement fe)                          //桌面上显示任何一个窗体
        {
            Panel p = CameraTestDesktop.getDesktopPanel();

            if (p.Children.Contains(fe))
            {
            }
            else
            {
                p.Children.Add(fe);
            }
        }
示例#10
0
        public void StartPhotoEdit()
        {
            Panel           p  = CameraTestDesktop.getDesktopPanel();
            PhotoEditCanvas pc = new PhotoEditCanvas();

            pc.Title = "Image Process System";
            p.Children.Add(pc);
            Canvas.SetLeft(pc, (p.ActualWidth - pc.Width) / 2);
            Canvas.SetTop(pc, (p.ActualHeight - pc.Height) / 2);

            ShowPhotoEditWindow(pc);
        }
示例#11
0
        public void ShowPhotoEditWindow(PhotoEditCanvas pc)
        {
            double l, t;//默认编辑是在右侧

            ShowWindow(pc);
            Panel p = CameraTestDesktop.getDesktopPanel();

            Canvas.SetLeft(pc, (p.Width - pc.Width) / 2);
            Canvas.SetTop(pc, (p.Height - pc.Height) / 2);

            l = Canvas.GetLeft(pc);
            t = Canvas.GetTop(pc);

            ShowWindow(WindowLayerEdit);
            WindowLayerEdit.setTarget(pc);
            Canvas.SetLeft(WindowLayerEdit, l + pc.Width);
            Canvas.SetTop(WindowLayerEdit, t);

            ShowWindow(WindowLayerDraw);
            WindowLayerDraw.setTarget(pc);
            Canvas.SetLeft(WindowLayerDraw, l);
            Canvas.SetTop(WindowLayerDraw, t - WindowLayerDraw.Height);

            ShowWindow(WindowPhotoIO);
            WindowPhotoIO.setTarget(pc);
            Canvas.SetLeft(WindowPhotoIO, l);
            Canvas.SetTop(WindowPhotoIO, t - WindowPhotoIO.Height - WindowPhotoIO.Height);

            ShowWindow(WindowLayerManager);
            WindowLayerManager.setTarget(pc);
            Canvas.SetLeft(WindowLayerManager, l - WindowLayerManager.Width);
            Canvas.SetTop(WindowLayerManager, t + 30);

            ShowWindow(WindowLayerMove);
            WindowLayerMove.setTarget(pc);
            Canvas.SetLeft(WindowLayerMove, l + pc.Width);
            Canvas.SetTop(WindowLayerMove, t - WindowPhotoIO.Height - WindowLayerDraw.Height);

            ShowWindow(WindowLayerInfor);
            WindowLayerInfor.setTarget(pc);
            Canvas.SetLeft(WindowLayerInfor, l);
            Canvas.SetTop(WindowLayerInfor, t + pc.Height);

            ShowWindow(WindowPhotoView);
            WindowPhotoView.setTarget(pc);
            Canvas.SetLeft(WindowPhotoView, l + pc.Width);
            Canvas.SetTop(WindowPhotoView, t + pc.Height + 70);
        }
示例#12
0
        private void buttondEV_Click(object sender, RoutedEventArgs e)
        {
            JBEVTest w = new JBEVTest();

            if (lChartPhoto.getPhoto() != null)
            {
                w.lPhotoList1.AddPhoto(lChartPhoto.getPhoto());
            }
            //w.lChartPhoto1.setPhoto(this.lChartPhoto.getPhoto());
            ActionShow.CenterShow(CameraTestDesktop.getDesktopPanel(), w);
            ci.ToIcon();
            //Canvas Desk = CameraTestDesktop.getDesktopPanel();
            //if (Desk.Children.Contains(this))
            //{
            //    Desk.Children.Remove(this);
            //}
        }